From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17698 invoked from network); 16 Aug 2004 12:42:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Aug 2004 12:42:48 -0000 Received: (qmail 36670 invoked from network); 16 Aug 2004 12:42:42 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Aug 2004 12:42:42 -0000 Received: (qmail 12383 invoked by alias); 16 Aug 2004 12:41:58 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7863 Received: (qmail 12373 invoked from network); 16 Aug 2004 12:41:57 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 16 Aug 2004 12:41:57 -0000 Received: (qmail 33850 invoked from network); 16 Aug 2004 12:40:22 -0000 Received: from sccimhc92.asp.att.net (63.240.76.166) by a.mx.sunsite.dk with SMTP; 16 Aug 2004 12:40:20 -0000 Received: from louisville.edu (12-220-223-80.client.insightbb.com[12.220.223.80]) by sccimhc92.asp.att.net (sccimhc92) with SMTP id <20040816124018i92009213le>; Mon, 16 Aug 2004 12:40:19 +0000 Date: Mon, 16 Aug 2004 08:40:17 -0400 Subject: Re: Slightly OT: Error-Handling in a Pipeline, preferably non-zsh Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v553) From: Aaron Davies To: zsh-users@sunsite.dk Content-Transfer-Encoding: 7bit In-Reply-To: Message-Id: <6D7144FA-EF81-11D8-83BE-000502631FBD@louisville.edu> X-Mailer: Apple Mail (2.553) X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.6 required=6.0 tests=BAYES_30,FROM_ENDS_IN_NUMS, RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.6 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 _ _ / (_(_/|_/ (_(_) / (_ (__/_(_/|_\/ <__