Hello,

the current shell standard says in Section 2.9.1:

-----------

If no command name results, variable assignments shall affect the current 
execution environment. 

If the command name is not a special built-in utility or function, the variable 
assignments (...) shall not affect the current execution environment (...) In 
this case it is unspecified: 

Whether or not the assignments are visible for subsequent expansions in step 4

-----------

As you can see, if we do have a command, the standard mentions that it is 
unspecified if the assignments are subsequently visible.  So one can say, it is 
needed to discuss the notion of subsequent visibility.


Yet if we don't have a command, the standard does not discuss that at all...

One could perhaps interpret that to mean, it is unspecified in that case also.  
That would mean, there is no need to discuss the notion of subsequent 
visibility.


Thus we apparently have a contradiction - one one hand there is a need to 
discuss some X, on the other, there is not.  


As an aside, for dash such assignments are not visible:

$ A=; A=a B=$A; echo $B 

$ 



but for bash, they are:

~>A=; A=a B=$A; echo $B 
a 
~>


Questions:

1.  Is that apparent contradiction a bug in the standard that should be fixed, 
either by adding the visibility clause for both cases, or deleting it for both 
cases? (in that case, I will make a report).

2.  In the larger sense, if the standard does not specify some behaviour that a 
shell must implement, does that automatically mean it is "unspecified" or 
"undefined", in the sense of Base Definitions, Section 1.5?

3. In this specific case, is it unspecified what the behaviour is? Or is it 
specified (which would mean dash or bash have a bug), and what is it?


Thank you

Mark

Reply via email to