If i try to change shell variable in a while cycle... it works:
------------------------- >8 -------------------------
$ a=3;while [ $a -lt 6 ];do a=$[a+1];done;echo "Res:" $a
Res: 6
------------------------- >8 -------------------------
And sometimes not:
------------------------- >8 -------------------------
$ a=3;echo | while [ $a -lt 6 ];do a=$[a+1];done; echo "Res:" $a
Res: 3
------------------------- >8 -------------------------
I think, it works like a subshell, but it shouldn't.
Thank You:
Peter.
GNU bash, version 2.05a.0(1)-release (i686-pc-linux-gnu)
Linux crash.home 2.4.18-3 #1 Thu Apr 18 07:31:07 EDT 2002 i686 unknown