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! :)



_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to