Bug in wc???

Jos Vos jos at xos.nl
Sun Jan 11 14:51:24 UTC 2004


On Sun, Jan 11, 2004 at 03:45:17PM +0100, Hans M?ller wrote:

> Hello when  i use the wc command i get many spaces. 
> for example:
> [frank at homer dnetc483-linux-x86-elf]$ ls|wc -l
>       6
> [frank at homer dnetc483-linux-x86-elf]$
> but at all scipt saples the output are:
> [xxxx at xxx]$ ls|wc -l
>  x
> [xxxx at xxx]$
> so i cannot use the output in a script. Who can help?

Then use

	ls | wc -l | sed 's/^ *//'

to strip the spaces.

-- 
--    Jos Vos <jos at xos.nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204





More information about the fedora-list mailing list