Jacob Meuser wrote:

> ah, nice.  I was worried about the leading spaces as well, but printf
> seems to take care of that:
> 
> $ tb=0; for i in *; do b=`wc -c < $i`; b=`printf "%d" $b`; \
> tb=`expr $tb + $b`; done; echo $tb

You didn't quote $b before passing it to expr, so the shell will strip
off spaces there.

$ tb=0; for i in *; do b=`wc -c < $i`; \
  tb=`expr $tb + $b`; done; echo $tb

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     [EMAIL PROTECTED]
_______________________________________________
EUGLUG mailing list
[EMAIL PROTECTED]
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to