This is not equivalent, you probably wanted:
commits=$(wc -l <../revs | tr -d " ")
Which relevant version(s) of wc do not accept filename arguments?
POSIX[1] seems to specify it. Or do you mean that there is some
subtle difference in its processing of stdin vs specified files?
[1]- http://www.opengroup.org/onlinepubs/000095399/utilities/wc.html
Michael Poole
This is not equivalent, you probably wanted:
commits=$(wc -l <../revs | tr -d " ")
Which relevant version(s) of wc do not accept filename arguments?
POSIX[1] seems to specify it. Or do you mean that there is some
subtle difference in its processing of stdin vs specified files?
Josh is right. The output *is* different because it contains the
filename as well. See
$ wc < .gitk | tr -d " "
2177551
$ wc .gitk | tr -d " "
2177551.gitk
cheers
m