From: Michael Wardle <michael@endbracket.net>
To: zsh-users@sunsite.dk
Subject: Re: nomatch/cshnullglob problems
Date: Fri, 31 Mar 2006 22:23:38 +1100 [thread overview]
Message-ID: <1143804218.5212.17.camel@pepper.endbracket.net.endbracket.net> (raw)
Hi Bart
Thanks for your explanations.
The script is being used in bash and zsh, and I'd rather not introduce
any Z shellisms such as the (D) qualifier. When I run the script
normally, it is inside an "emulate -L ksh", so there's no big problem.
I think adding a dummy wildcard to the list might be the simplest
workaround.
Would you believe I had set "nonomatch" in tcsh, so tcsh was in a sense
emulating ksh, while zsh was emulating csh! (This explains why I wasn't
getting an error with the equivalent foreach loop in tcsh.)
"Fatal" was the best short way I could think of describing the
behavior. :-)
Under what circumstances should sourcing of a script short-circuit? A
very simple script such as:
-----
echo start
false
echo finish
-----
echoes "finish" and runs to completion when sourced, yet:
-----
echo start
echo /nosuchfile*
echo finish
-----
exits before echoing "finish".
It seems to be only if a pattern fails, which doesn't seem all that
useful! It's also disappointing that bash and zsh differ in this
respect.
Can I suggest a simple patch to the manual such as the following:
--- builtins.yo 20 Mar 2006 11:06:24 -0000 1.84
+++ builtins.yo 31 Mar 2006 11:04:47 -0000
@@ -48,6 +48,9 @@
they become the positional parameters; the old positional
parameters are restored when the var(file) is done executing.
The exit status is the exit status of the last command executed.
+
+If an error occurs due to a non-matching filename glob, the tt(.)
command returns
+to the shell and no further commands from var(file) are executed.
)
findex(NOTRANS(:))
cindex(expanding parameters)
I hope the mark-up is correct. I don't speak YODL. :-)
Thanks
Michael
next reply other threads:[~2006-03-31 11:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-31 11:23 Michael Wardle [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-31 9:52 Bart Schaefer
2006-03-30 23:02 Michael Wardle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1143804218.5212.17.camel@pepper.endbracket.net.endbracket.net \
--to=michael@endbracket.net \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).