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: Pádraig Brady
Subject: Re: Feature request for wc new switch -t
Date: Fri, 03 Jul 2015 17:43:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 03/07/15 17:21, Leslie S Satenstein wrote:
> 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

Already supported with:

lines=$(wc -l < somefile)

cheers,
Pádraig.



reply via email to

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