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.
