On Wed, Feb 23, 2005 at 10:33:14PM +1100, Herbert Xu wrote:
> I'd like to present a different fix though.  I'd prefer to keep the
> set -e behaviour within the string being evaluated.  In other words,
> 
> set -e
> if eval 'false; echo hi'; then :; fi
> 
> should not execute the echo statement.  Please give this patch a spin.

I ran into one problem while testing it, but didn't have the time to
investigate yet.

A subshell forked in eval or a dot file within an or list does not
return, causing the parent shell to block:

$ ./build-tmp/src/dash -exc 'eval "(false; false)" || echo 1'
+ eval (false; false)
+ false
+ echo 1
1
(does not return)

$ cat >t <<\EOT
(false; false)
EOT
$ ./build-tmp/src/dash -exc '. ./t || echo 1'
+ . ./t
+ false
+ echo 1
1
(does not return)

Regards, Gerrit.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to