Difficulty with wc

Andreas Erb <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Organization Siemens AG
Message-ID <[email protected]>
Hi,

wc -l

does give a result with leading blanks. This makes it difficult to work 
with the result in scripts, like:
N=$(ls | wc -l)
to know the number of entries in a directory.

I now get arround it with sed - but it seems quite uncomfortable to 
invoke another time consuming program just to "clean up" a simple result.

Regards
Hearp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.