[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Using awk



Hi Imran, Hi Jonathan,

I too am interested in the /%/ construct. You didn't miss it in the manual page, Imran, it isn't mentioned.

I see that % can be a format control letter, but in between slashes it would appear to be a pattern.

I *guess* that it simply finds everything - but I can't prove it. I tried Googling and Asking Jeeves but was unable to find a definitive explanation. The issue with awk isn't that there isn't enough documentation, there's much, much too much!

What does it mean, Jonathan?

Best,

James
=====

Imran Javeed wrote:
Thanks jonathan

I did look on the man page but must have missed it somewhere..


Imran
-----Original Message-----
From: Jonathan <jonathan [at] sirtis.org.uk>
Date: Fri, 28 Jan 2005 10:06:45 To:shef-lug [at] list.sheflug.org.uk
Subject: Re: [Sheflug] Using awk

Imran Javeed wrote:

On Thursday 27 January 2005 16:41, Jonathan wrote:


Jonathan wrote:
root [at] server# df | awk /%/ | sort +5
/dev/ar0s1a   1012974    53260   878678     6%    /
devfs               1        1        0   100%    /dev
/dev/ar0s1d   1012974     9490   922448     1%    /tmp
/dev/ar0s1f  65327520 15440068 44661252    26%    /usr
/dev/ar0s1e   8122126    62762  7409594     1%    /var

- J
In the above line
root [at] server# df | awk /%/ | sort +5

what is the awk /%/ actually doing, what difference is it from

df | sort +5

could someone please explain?

Imran, have you tried looking at the man page for awk? There's a lot of information on awk available on google as well.

The awk line in question outputs those lines containing %.

If you run "df" followed by "df | awk /%/" you can compare the outputs.

Regards,

Jonathan


___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

 GNU the choice of a complete generation.