Code Comments
Programming Forum and web based access to our favorite programming groups.yaniv asked:
> I need to extract the last argument of a given line, when number of
> arguments in line is unkown.
The number of fields is not unknown, you may search the awk-manual for
"Built-in Variables" --> NF.
stefan2@platon:~/test> awk '{print $NF}' << EOF
> 1 2 3 4
> 1 2 3
> 1 2
> 1
> EOF
4
3
2
1
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.