Bug#619786: texi2dvi: Syntax error: Bad function name when dash is /bin/sh (uses "local" as function name)
Hilmar Preusse wrote:
> You forwarded that bug only to the bug mailing list. Today I wanted
> submit it to their official BTS, but failed to reproduce the bug:
>
> hille@drachi:~/t1$ texi2dvi a.texi
[...]
> This is not Debian unstable, but Debian stable but it should not make
> any difference. What am I missing?
"local" became a special builtin in commit 1d806ac1 ([VAR] Do not
poplocalvars prematurely on regular utilities, 2010-05-27), which is
in experimental but not stable or sid. Since I last wrote, Jilles
Tjoelker convinced[1] me that "local" ought not to be a special
builtin despite the analogy with "typeset" and "export", so maybe such
a problematic version of dash will never hit Debian unstable.
Anyway, this should be reproducible with dash from experimental.
Sorry for the confusion. I find this to be close enough to the edge
of portable behavior to not be a great idea in scripts, but that is
more wishlist than important.
$ ksh93 -c 'typeset () { echo hi; }'
ksh93: line 1: typeset: invalid function name
$ ksh93 -c 'export () { echo hi; }'
ksh93: line 1: export: invalid function name
$ ksh93 -c 'local () { echo hi; }'
$
Thanks and hope that helps,
Jonathan
[1] http://bugs.debian.org/619725
Reply to: