> 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.

Reply via email to