[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: weird ksh eval behavior
From: |
Ralf Wildenhues |
Subject: |
Re: weird ksh eval behavior |
Date: |
Fri, 2 Dec 2005 15:54:55 +0100 |
User-agent: |
Mutt/1.5.11 |
[ limiting to autoconf-patches ]
Hi Paul,
* Paul Eggert wrote on Thu, Dec 01, 2005 at 10:04:02PM CET:
> Ralf Wildenhues <address@hidden> writes:
>
> > is this behavior considered "common knowledge" or should it be
> > mentioned in the Autoconf shell portability section?
>
> The latter, I think. I installed this:
Thanks. I noticed a couple of nits:
> --- autoconf.texi 10 Nov 2005 18:57:58 -0000 1.933
> +++ autoconf.texi 1 Dec 2005 21:02:40 -0000 1.934
> @@ -11120,6 +11123,25 @@ $foo
> EOF
> @end example
>
> +
> address@hidden @command{eval}
> address@hidden -----------------
> address@hidden @command{eval}
> +In some shell implementations (e.g., @command{ash}, OpenBSD 3.8
This is fixed in recent ash, it was just the old one shipped with Fedora
Core 3. May or may not be relevant.
> address@hidden, @command{pdksh} v5.2.14 99/07/13.2, and @command{zsh}
> +4.2.5), the arguments of @samp{eval} are evaluated in a context where
> address@hidden is 0, so they exhibit behavior like this:
> +
> address@hidden
> +$ false; eval 'echo $?'
> +0
> address@hidden example
> +
> +The correct behavior here is to assign a nonzero value to @samp{foo},
There is no other mention of `foo' in this context.
> +but portable scripts should not rely on this.
> +
> +You should not rely on @code{LINENO} within @command{eval}.
> address@hidden Shell Variables}.
>
> @item @command{exit}
> @c -----------------
Cheers,
Ralf