coreutils
[Top][All Lists]
Advanced

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

Re: Feature request for wc new switch -t


From: Leslie S Satenstein
Subject: Re: Feature request for wc new switch -t
Date: Fri, 3 Jul 2015 16:21:58 +0000 (UTC)

There are numerous situations where of the following

mycount = wc -l somefile         
mycount is very very often followed by
cut -d' ' -f1 as
lines=$(wc -l somefile | cat -d' ' -f1)

In otherwords,  we want the numerical value lines, but not the text following.  A new flag, -n would be useful as in

lines=wc -t somefile       to be equivalent to    lines=$(wc -l somefile | cat -d' ' -f1).

Savings would be the piping of the wc output followed by call to external file "cut".       

-t for truncated



reply via email to

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