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.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to