[ale] Question about awk
Chuck Payne
terrorpup at gmail.com
Thu Sep 17 10:34:02 EDT 2009
On Thu, Sep 17, 2009 at 10:24 AM, Chuck Payne <terrorpup at gmail.com> wrote:
> On Thu, Sep 17, 2009 at 8:40 AM, Ed Cashin <ecashin at noserose.net> wrote:
>> On Thu, Sep 17, 2009 at 7:36 AM, Geoffrey <lists at serioustechnology.com> wrote:
>> ...
>>> awk -F '[\\[\\]]' '/Recipient address rejected/ {print $10}'
>>
>> Bravo! :)
>>
>> For fields that are near the end, it's sometimes more readable or
>> convenient to use the "NF" variable for number of fields, like this:
>>
>> bash$ echo one two three four | awk '{print $(NF-1)}'
>> three
>>
>> Not sure if that's helpful here, but I like that awk feature.
>>
>> --
>> Ed Cashin <ecashin at noserose.net>
>> http://noserose.net/e/
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>>
>
> Got the information I want, do I use the string like this?
>
> awk -F '[\\[\\]]' '/Recipient address rejected/ {print $10}' mail.log
>
> --
> ----------------------------------------
> Discover it! Enjoy it! Share it! openSUSE Linux.
> -----------------------------------------
> openSUSE -- http://en.opensuse.org/User:Terrorpup
> openSUSE Ambassador
> openSUSE Member
> skype -- terrorpup
> twitter -- terrorpup
> friendfeed -- http://friendfeed.com/terrorpup
>
> Come join me at the Atlanta Linux Fest, September 19th, 2009
> http://atlantalinuxfest.org/.
>
If I do .....
awk -F '[\\[\\]]' '/Recipient address rejected/ {print $10}' mail
You can tell that it looking, because you can see a whole bunch of
blank lines go by.
--
----------------------------------------
Discover it! Enjoy it! Share it! openSUSE Linux.
-----------------------------------------
openSUSE -- http://en.opensuse.org/User:Terrorpup
openSUSE Ambassador
openSUSE Member
skype -- terrorpup
twitter -- terrorpup
friendfeed -- http://friendfeed.com/terrorpup
Come join me at the Atlanta Linux Fest, September 19th, 2009
http://atlantalinuxfest.org/.
More information about the Ale
mailing list