On 04/05/15 00:30, Leslie S Satenstein wrote:
> While there is nothing wrong with wc as is, a suggestion after some use.
> 
> With wc -l  it emits the line count  and the program name(s) as   "nnn  
> program-name".
> 
> With the additional switch option, it would be convenient to drop the program 
> name.
> 
> It would be equivalent to  `wc -l  programname | cut -d' '`
> It would be equivalent to   `wc -c|m|L|w programname | cut -d'' `
> 
> In other words, just present the count without the program name.
> Suggest   *-n* or --nonames (for drop the program name)
> 
> wc -l -n  prognames
> 
> or
> 
> wc -l --nonames  prognames

The usual case of wanting a total count can be achieved with:

  wc -l < file1
  cat file1 file2 | wc -l

The unusual case of wanting separated counts without file names
can be achieved with:

  wc -l file1 file2 | awk '{print $1}'

thanks,
Pádraig.

Reply via email to