compressing 0 modules

Elan Ruusamäe glen at delfi.ee
Wed Jan 30 11:57:20 CET 2008


On Wednesday 30 January 2008 11:47:01 Tomasz Pala wrote:
> 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

thanks. took different approach:
if [ "$files" ]; then
  echo "$files" | wc -l
fi

-- 
glen


More information about the pld-devel-en mailing list