Morten Karlsen wrote:
> cut -f-1
>
> Get last field in line....
>
> Interested?
Personally I recommend using awk. Then you are not dependent upon a
particular implementation of cut and can use standard tools which are
available on all systems.
awk '{print $(NF-1)}'
echo one two three | awk '{print $1}'
one
echo one two three | awk '{print $NF}'
three
echo one two three | awk '{print $(NF-1)}'
two
Hope that helps.
Bob
_______________________________________________
Bug-textutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-textutils