Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Slightly OT: Error-Handling in a Pipeline, preferably non-zsh
- X-seq: zsh-users 7863
- From: Aaron Davies <agdavi01@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Slightly OT: Error-Handling in a Pipeline, preferably non-zsh
- Date: Mon, 16 Aug 2004 08:40:17 -0400
- In-reply-to: <Pine.LNX.4.61.0408160032060.21654@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
On Monday, August 16, 2004, at 03:41 AM, Bart Schaefer wrote:
On Sun, 15 Aug 2004, Aaron Davies wrote:
As a final note, you probably want "$@" in double quotes.
Really? I used it with multi-word commands (like "kill -9") with no
problems.
What happens when one of the arguments of the command is a quoted word
containing spaces? E.g. supposing your "generalized killall" is named
"runcommandonpidof" (since you've never told us what it _is_ called),
try
It's called "toall".
sleep 30 &
runcommandonpidof sleep print -l "this should be on one line"
(and try it in a non-zsh shell, where word splitting applies; no
cheating by letting zsh preserve the quoting for you, you asked for
portability).
What is "print"? There doesn't seem to be an executable of that name on
my (OS X 10.3) box, and printf doesn't have a "-l" option. I tried
something similar with echo, and saw no difference.
toall sleep echo "this is one line"
produces
this is one line 19980
whether or not $@ is in quotes. (I was invoking the script from sh,
which I think on this box is actually bash running in sh-mode.)
--
__ __
/ ) / )
/--/ __. .__ ______ / / __. , __o _ _
/ (_(_/|_/ (_(_) / (_ (__/_(_/|_\/ <__</_/_)_
Messages sorted by:
Reverse Date,
Date,
Thread,
Author