On 28/01/2019 06:38, Stephane Chazelas wrote:
I'm saying POSIX should not make the behaviour unspecified for
empty aliases. Only, if at all, when the expansion results in no
command. Because empty aliases are useful when followed by
something else like in the example I gave.

That makes sense, though it may be difficult to specify properly.

[...]
And dash has no issue with that code.

It does have an issue with exactly what you wrote: try putting ifdebug
before the very last line in a script, in the non-DEBUG case where the
command is commented out.
[...]

alias ifdebug=
ifdebug echo DEBUG

works fine in dash AFAICT.

The non-DEBUG case is alias ifdebug=# to comment out the command.

  $ dash <<EOF
  > alias ifdebug=#
  > ifdebug echo DEBUG
  > EOF
  dash: 3: Syntax error: end of file unexpected

Cheers,
Harald van Dijk

Reply via email to