[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: texi2dvi is a bash script, not a Bourne shell script
From: |
Andreas Schwab |
Subject: |
Re: texi2dvi is a bash script, not a Bourne shell script |
Date: |
Wed, 01 Jul 2015 23:58:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Gavin Smith <address@hidden> writes:
> On 1 July 2015 at 21:43, Gavin Smith <address@hidden> wrote:
>>
>> I seem to remember there was something wrong about the "local"
>> function, but I can't remember what it was.
>
> This test for "local" is flawed:
>
> (
> foo=bar
> test_local () {
> local foo=foo
> }
> test_local >/dev/null 2>&1
> test $foo = bar
> ) || eval '
> local () {
> case $1 in
> *=*) eval "$1";;
> esac
> }
> '
> It appears to assume that "local foo=foo" will assign "foo" to foo if
> local doesn't exist, but in fact all it does is print an error
> message, and leave foo as was.
What's the point of this anyway? Why not just remove all uses of local
if it's expected to do nothing?
Andreas.
--
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."