2017-06-06 14:04:39 +0100, Stephane Chazelas:
> OK, going forward, to fix the spec, would we be in agreement
> that the spec should guarantee this:
> 
> In:
> 
> sh - <anything>
> 
> Where <anything> can be any number argument starting with -, +,
> being "--", "-" or not.
> 
> Those <anything> would be taken as operands (the first being the
> script name, the rest its arguments)
[...]

Clarifying: that <anything> may also be the empty list as in "sh
-" is the same as "sh" alone (not particularly useful, but seems
to work the same in all implementations).

By the way, do we also need to say something about whether the
options on the sh command lines are processed before or after
the $ENV file is processed (for those that do as that's an
optional feature).

If $ENV is a file that contains "set +x", may running "sh -x"
end up with "-x" still enabled?

That would be quite unexpected (especially considering that
whether $ENV is processed or not depends on the option parsing),
but it might be worth stating explicitely. Something like: the
content of the $ENV variable will be expanded and the content of
the file at the resulting path will be interpreted after all options
have been processed and before the first prompt is issued.

-- 
Stephane

Reply via email to