compressing 0 modules

Tomasz Pala gotar at polanet.pl
Wed Jan 30 10:47:01 CET 2008


On Wed, Jan 30, 2008 at 10:31:54 +0200, Elan Ruusamäe wrote:

> any suggestions how to make the counting proper for empty and non-empty list?
> 
> with echo -n:
> $ echo -n /lib/modules/2.6.22.16-3/misc/nvidia.ko | wc -l
> 0
> 
> $ echo -n ""| wc -l
> 0

echo "" | while read line; do [ -n "$line" ] && echo $line; done | wc -l
0

echo "asdasd" | while read line; do [ -n "$line" ] && echo $line; done | wc -l
1

-- 
Tomasz Pala <gotar at pld-linux.org>


More information about the pld-devel-en mailing list