* =nonexistent crashes scripts
@ 2004-11-24 18:32 kynn
2004-11-24 18:51 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: kynn @ 2004-11-24 18:32 UTC (permalink / raw)
To: zsh-users
Sourcing the following script
unsetopt errexit
FOO==ls 2>/dev/null
echo OK
FOO==nonexistent 2>/dev/null
echo OK
produces only one "OK" before the script crashes. This seems like
a serious bug to me; it makes the =command facility all but useless.
Is there any way around this?
kynn
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: =nonexistent crashes scripts
2004-11-24 18:32 =nonexistent crashes scripts kynn
@ 2004-11-24 18:51 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2004-11-24 18:51 UTC (permalink / raw)
To: kynn; +Cc: zsh-users
On Wed, 24 Nov 2004 kynn@panix.com wrote:
> This seems like a serious bug to me; it makes the =command facility all
> but useless. Is there any way around this?
It's not a bug, it's an intentional feature of file expansion. Try
"setopt nonomatch".
Or don't use file expansion. =command was really meant as a shortcut for
interactive command entry, not as a scripting tool. In a script you
should be using something like
FOO=$(whence -p nonexistent)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-11-24 18:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-24 18:32 =nonexistent crashes scripts kynn
2004-11-24 18:51 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).