Sujet : Re: An interesting little quirk - difference between "bash" and "dash" (Linux)
De : naddy (at) *nospam* mips.inka.de (Christian Weisgerber)
Groupes : comp.unix.shellDate : 05. Jan 2025, 21:27:59
Autres entêtes
Message-ID : <slrnvnlqqf.esd.naddy@lorvorc.mips.inka.de>
References : 1
User-Agent : slrn/1.0.3 (FreeBSD)
On 2025-01-05, Kenny McCormack <
gazelle@shell.xmission.com> wrote:
foo=bar;myfun() { local foo; echo "In myfun(), foo = $foo"; };myfun
>
I'm not standards obsessed like some people in these newsgroups; I care
more about desirable functionality. In this case, I would not be surprised
to hear that the dash behavior is more POSIX-ly correct,
Surprisingly, "local" isn't part of the POSIX shell language at all.
Its only mention is under "If the command name matches the name of
a utility listed in the following table, the results are unspecified".
Is there any POSIX-y shell that does not implement "local"?
-- Christian "naddy" Weisgerber naddy@mips.inka.de