bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

variables in while-pipe-line


From: Peter Vazsonyi
Subject: variables in while-pipe-line
Date: Sun, 1 Sep 2002 17:37:10 +0200
User-agent: Mutt/1.3.28i

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]