From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25314 invoked from network); 21 Jul 1997 19:05:37 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 21 Jul 1997 19:05:37 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA21385; Mon, 21 Jul 1997 14:57:37 -0400 (EDT) Resent-Date: Mon, 21 Jul 1997 14:56:55 -0400 (EDT) From: "Bart Schaefer" Message-Id: <970721115258.ZM10155@candle.brasslantern.com> Date: Mon, 21 Jul 1997 11:52:58 -0700 In-Reply-To: <9707211605.AA17539@ezdzit.zko.dec.com> Comments: In reply to Paul Lew "delay argument interpretation" (Jul 21, 12:05pm) References: <9707211605.AA17539@ezdzit.zko.dec.com> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Paul Lew , zsh-users@math.gatech.edu Subject: Re: delay argument interpretation MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"tCXYz3.0.PD5.s3xqp"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/961 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 21, 12:05pm, Paul Lew wrote: } Subject: delay argument interpretation } } This all work out nice, however, the comment blocks in these files are } different and I would like to apply a filter (rmcmt in the example } below) to it so I will only see the source differences: } } for i in *.c; do } ask diff =(rmcmt old/$i) =(rmcmt $i) } done The obvious solution to this specific problem is to use "diff -I " to ignore lines matching the regular expression . The other solution that occurs to me is function diffsrc() { local x=$[$#-2] diff $*[1,$x] =(rmcmt $*[$x+1]) =(rmcmt $*[$x+2]) } for i in *.c; do ask diffsrc old/$i $i; done } What can I do to quote the arguments so it will not expand until } later in function ask? Something like what Zefram suggested is the only way; really do quote them yourself. In csh I'd use an alias with \!: expansions like this: alias ask 'echo -n \!*:q"? [y/n] "; askify \!*' (and then "askify" would be a script that does everything but the echo in your "ask"). But zsh doesn't have such a mechanism for re-quoting the command line at alias time, before any of it gets expanded. The closest you can get is somthing like alias ask='noglob ask' which delays filename expansion but not command name substitution et. al. I have this little function: show () { show=() show=($~*) print -rc $show } alias show='noglob show' which allows me to do things like show **/*.{orig,rej} (examine what I see for a bit, then do something else like) rm $show (which avoids doing the recursive glob twice). My only complaint about this is that completion for "noglob" gets invoked if I happen to press TAB, rather than completion for "show". I think that's a bug. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com