Why would you use "-w"?

Anyway, try ...
    egrep '^8[^0-9] /proc/cyclades

The first "^" says to root at the start of the line
The 8 says to look for 8
The [] says to examine only these characters (those between brackets).
The second ^ says to accept anything that does not match whats between
brackets
The 0-9 specifies the character range.

If you know that the line is always the nth line (like in this case the 9th
line) it is much
more efficient to do something like:
  awk ' if ( NR > LINENO ) exit; if ( NR == LINENO ) print $0 }' LINENO=9
</proc/cyclades

Take care,

    - Bruce


Robert Canary wrote:

> Hi,
>
> This is really a silly question, but ...........
>
> I need to extract a single line from a /proc file.  The lines are sorted
> by the first column, which are always 0,1,2,3,4,...,60,61,62,63,64.   I
> treid doing something like:
> cat /proc/cyclades | egrep -w "8" but it returns *every* line with an
> 8.  How can I do this without going through a loop?
>
> Thanks in advance ;-)
>
> --
> robert canary
> system services
> OhioCounty.Net
> [EMAIL PROTECTED]
> (270)298-9331 Office
> (270)298-7449 Fax
>
> --
> To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
> as the Subject.


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to