17.11.2024 22:00, Klemens Nanni пишет:
> I can't say right away what the shell is supposed to do here and/or what it
> really does;  looks like it expands the alias and before function definition.

That's what it does:

        $ alias foo=bar
        $ foo() {}
        $ typeset -f foo
        $ typeset -f bar
        bar() {}

So the original login='exec login' ends up as

        $ exec login() ...
        sh: syntax error: `(' unexpected

It fails like that no matter what comes after (), which seems fair.

Now one could compare that behaviour with other shells, check standards
and try argue, what (not) to do... I won't open that box of pandora myself ;)

Reply via email to