lkml.org 
[lkml]   [1997]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: procfs problems
> > Anyway, I don't see why there is such a big deal being made about this,
> > when it's not too hard to do...

On Apr 30, Dan Hollis wrote
> You've obviously never tried. :-/

I've been successful every time I've gotten into this kind of thing.

Here's the most useful shell idioms:

read first second third rest
cut -f2 -d' '
cut -c8-15
awk '{print $3}'
Note that cut has very different parsing semantics from read and awk.

Note that sed can be good for trimming off the first couple
of lines (e.g. sed 1,2d), if you don't want the human readable
headers.

C is even more powerful, since you can use flex (you want flex
idioms too?).

--
Raul

\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2011 Jasper Spaans