bug-coreutils
[Top][All Lists]
Advanced

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

wc annoyances


From: Daniel Russell
Subject: wc annoyances
Date: Fri, 18 Jul 2003 20:30:49 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030708 Thunderbird/0.1a

Using wc in scripts is annoying because of the fact that this:

wc -l/m/c FILENAME

prints this:

        NUMBER FILENAME

And there appears to be no options to turn this behavior off. Of course, I would like to use wc a lot in scripts, without having to pipe into it. I would like to have no leading whitespace, and would most definitely like to have no filename. Such behavior breaks scripts like this:

echo -n $([ `cat autolist-next.num` -gt `wc -l autolist.txt` ] && echo 1 || echo 0)

bash complains that there are too many arguments to [ ] because of the uncessary filename.

Can we have an options "-b"/"--bare" which would strip leading and trailing whitespace and print only the number requested??

Thanks! :)





reply via email to

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