[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wc function proposal for an additional switch -? (choose letter ?
From: |
Pádraig Brady |
Subject: |
Re: wc function proposal for an additional switch -? (choose letter ? |
Date: |
Mon, 04 May 2015 01:53:35 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
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.