zsh-users
 help / color / mirror / code / Atom feed
* Re: delay argument interpretation
@ 1997-07-22 17:28 Zoltan T. Hidvegi
  0 siblings, 0 replies; 7+ messages in thread
From: Zoltan T. Hidvegi @ 1997-07-22 17:28 UTC (permalink / raw)
  To: hzoli; +Cc: schaefer, zsh-users

hzoli wrote:
> > The latter fails to set $show to empty when the pattern doesn't match
> > anything.  I have nomatch set, so if there's a globbing failure in the
> > arg list, "show" never executes.  I want to force "show" to start, and
> > *then* get the globbing failure.
>
> Alias show to noglob show.

Oh, I did not read the beginning of the mail.  Sorry for my ignorance.

Zoltan


^ permalink raw reply	[flat|nested] 7+ messages in thread
* delay argument interpretation
@ 1997-07-21 16:05 Paul Lew
  1997-07-21 16:43 ` Andrew Main
  1997-07-21 18:52 ` Bart Schaefer
  0 siblings, 2 replies; 7+ messages in thread
From: Paul Lew @ 1997-07-21 16:05 UTC (permalink / raw)
  To: zsh-users

I have a shell function 'ask' to aid the interactive command
execution, for example,

	function ask {
		echo -n "$*? [y/n]: "
		read yon
		if [[ "$yon" = "y" ]]; then
			$@
			echo "end of: $@"
			fi
		}

Then I can use commands similar to the one below to interactively
select the desired candidates:

	for i in *.c; do
		ask diff old/$i $i
		done

will work like:

	diff old/a.c a.c? [y/n]: 
	diff old/b.c b.c? [y/n]: 
	diff old/c.c c.c? [y/n]: 

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

However the =(...) expanded info a temporary filename and the prompt
became:

	diff /tmp/zshaaqqxa /tmp/zshaaqqxb? [y/n]:
	diff /tmp/zshaaqqxa /tmp/zshaaqqxb? [y/n]:
	diff /tmp/zshaaqqxa /tmp/zshaaqqxb? [y/n]:

What can I do to quote the arguments so it will not expand until
later in function ask?  Any help will be appreciated...


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-07-22 17:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-22 17:28 delay argument interpretation Zoltan T. Hidvegi
  -- strict thread matches above, loose matches on Subject: below --
1997-07-21 16:05 Paul Lew
1997-07-21 16:43 ` Andrew Main
1997-07-21 18:52 ` Bart Schaefer
1997-07-22  8:23   ` Andrew Main
1997-07-22 16:10     ` Bart Schaefer
1997-07-22 17:25       ` Zoltan T. Hidvegi

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).