[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sh portability questions
From: |
Akim Demaille |
Subject: |
Re: sh portability questions |
Date: |
Wed, 28 Sep 2005 13:36:11 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
>>> "Andreas" == Andreas Schwab <address@hidden> writes:
> Akim Demaille <address@hidden> writes:
>> if (local foo) >/dev/null 2>&1; then :; else
>> local () { true; }
>> fi
> Note that local is only valid in function context, so this will always
> produce a failure.
Thanks, I didn't know. How about this then?
(
foo=bar
test_local () {
local foo=foo
}
test_local
test $foo = bar
) || local () {
case $1 in
*=*) eval "$1";;
esac
}