bug-textutils
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]