[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature request
From: |
Bob Proulx |
Subject: |
Re: Feature request |
Date: |
Sat, 22 Feb 2003 10:14:21 -0700 |
User-agent: |
Mutt/1.3.28i |
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
- Feature request, Morten Karlsen, 2003/02/21
- Re: Feature request,
Bob Proulx <=