bug-coreutils
[Top][All Lists]
Advanced

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

Re: wc


From: Pádraig Brady
Subject: Re: wc
Date: Fri, 12 Jun 2009 15:00:56 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Pádraig Brady wrote:
> 
> You probably want to squeeze adjacent blanks:
> 
> wc FILE | tr -s '[:blank:]' ' ' | cut -d' ' -f2

Note you might wonder why cut doesn't support -d'[:blank:]'
to auto skip runs of horizontal whitespace. Details here:

http://lists.gnu.org/archive/html/bug-coreutils/2009-05/threads.html#00153

Note also that wc can output particular counts in isolation.
I.E. this will get the same affect as your original:

wc -w FILE | cut -d' ' -f1

cheers,
Pádraig.




reply via email to

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