* Stephan Kulow
Am Mittwoch 24 März 2010 schrieb Michael Matz:
I trust that that one is more capable than our ash? : % /bin/ash -c 'i=0; j=$((i+1))' arith: syntax error: "i+1"
Make it $i - then both ash and dash can do it.
Note that $i and i lead to different behavior with arithmetic expansion. $(( $i+1 )) happily yields 1 if i is set to a non-integer while $(( i+1 )) results in a syntax error. The latter is almost alway what you want since it catches potential errors. Assignments also do not work with $i, $(( $i=1 )) is an error while $(( i=1 )) is valid and assigns i. Except for legacy scripts it is probably a better idea to use dash since it has many other issues fixed. -- Guido Berhoerster -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org