> So far, so good. But.... > > imadev:~$ foo() { echo foo; } > imadev:~$ foo=bar > imadev:~$ is_defined3 foo ; echo $? > 1
Ouch! Last try: is_defined4() { declare -p -- "$1" 2>/dev/null >&2 } But I agree with you, the shell is tricky.
Eduardo A . Bustamante López Wed, 19 Nov 2014 15:36:33 -0800
> So far, so good. But.... > > imadev:~$ foo() { echo foo; } > imadev:~$ foo=bar > imadev:~$ is_defined3 foo ; echo $? > 1
Ouch! Last try: is_defined4() { declare -p -- "$1" 2>/dev/null >&2 } But I agree with you, the shell is tricky.