[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: text editing



On Sat, May 24, 2003 at 01:44:38PM +0900, Tsuyoshi Takada wrote:
> $ wc -l 1.txt
> returns
> " 150 1.txt"
> 
> I want to extract the lines count "100" as the following,
> 
> $ wc -l 1.txt | <some sommand>
> returns
> 100

Either:

  wc -l < 1.txt | sed -e 's/^ *//'

or:

  wc -l 1.txt | sed -e 's/^ *//' | cut -d' ' -f1

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: