On Mon, Jun 09, 2008 at 03:36:29PM +0100, Stephane Chazelas wrote: [...] > I was about to submit another bug report about that (the fact > that a=x b=$a; echo $b doesn't output x) when I saw there was > one already. > > I was surprised to see: > > Tags: wontfix; > > I read through the lengthy discussion, but it doesn't explain > why it's tagged as wontfix. > > Both common sense and SUSv3 state clearly that it is a bug. > > In the Bourne shell, assignments were performed right to left > (you had to do "b=$a a=x"). And I seem to recall reading (either > in the standard itself or in some mailing list about it), that > POSIX had made it clear that it should be performed left to > right to avoid such unintuitive oddities. > > Anyway, it's true that at least FreeBSD sh has the same problem, > so one should avoid such a syntax anyway for the time being. [...]
There are other issues: 1$ a=x command eval 'echo $a' 2$ f() { echo $b; } 3$ b=x f x 4$ echo $b x (1) should have output "x" and (4) shouldn't have output "x" if I read POSIX correctly. -- Stéphane -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]