On 15/01/2019 11:15, Joerg Schilling wrote:
Harald van Dijk <[email protected]> wrote:
Can there be an alternative rewording that specifies the behaviour in
even more cases, where the resulting text is still both correct and
understandable, and the extra cases are verified to work the same way on
all current shells? If there is, I suspect that coming up with that
wording is the approach most likely to get the result you are after
(which I would like to see myself as well, even though I do not feel as
strongly about it as you).
I would support a rewording that is based on the fact that all known
implementations stack the alias replacement to the input and re-call the lexer.
This makes everything useful that results in legal shell syntax after the alias
replacement.
As a starting point for figuring out which cases should be excluded, the
aliases that I know do *not* work across all current alias-supporting
POSIX shells are aliases that
- are empty,
- leave the lexer in a state where the character that delimits the alias
name can combine with characters resulting from the alias substitution
(whether as part of a token or as part of a comment), or
- end in a quoted blank.
Are there other cases that are known not to work on some shells?
Are there uses that this excludes that do work on all shells and are
useful to support?
A big thing about issue 953 is the restriction on ASSIGNMENT_WORDs and
redirections. Was this based on knowledge of real shells that do not
handle this, or was this based on concerns for hypothetical implementations?
Cheers,
Harald van Dijk