From: Paul Lew <lew@ezdzit.zko.dec.com>
To: zsh-users@math.gatech.edu
Subject: delay argument interpretation
Date: Mon, 21 Jul 1997 12:05:12 -0400 [thread overview]
Message-ID: <9707211605.AA17539@ezdzit.zko.dec.com> (raw)
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...
next reply other threads:[~1997-07-21 16:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-07-21 16:05 Paul Lew [this message]
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
1997-07-22 17:28 Zoltan T. Hidvegi
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=9707211605.AA17539@ezdzit.zko.dec.com \
--to=lew@ezdzit.zko.dec.com \
--cc=zsh-users@math.gatech.edu \
/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).