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

Re: wc -l behaviour



-f wrote:
> why the extra whitespace?

Because that's how it's coded

> could the behaviour be changed that when one of -c, -l, -m, -w
> was specified, the whitespace was trimmed?

Of course!

> isn't that sensible?

You have my blessing, but you have to take POSIX in account:

  http://www.opengroup.org/onlinepubs/009695399/utilities/wc.html

And that the GNU version of wc doesn't do it doesn't mean BSD
shouldn't do it. Though I admit I can't find anything that says
that leading whitespace must be added.


In the meantime I hope this will do for you:

  wc -l < .zshrc | sed -e 's| ||g'



# Han