From: "Jack McKinney" <jackmc-zsh-users@lorentz.com>
To: zsh-users@sunsite.auc.dk
Subject: converting parameter to words
Date: Fri, 13 Oct 2000 10:48:19 -0500 [thread overview]
Message-ID: <20001013104819.A32478@stocks.pillory.com> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
I have a script that I want to pass multiple arguments to. These
arguments, however, need to appear with a '-r' in front of them in the
command executed inside the script. For example, if I do this:
$ example this that other
The script will need to execute
command -r this -r that -r other
One thought on this was:
#!/bin/zsh
for i
do
temp="$temp -r $i"
done
command $temp
Of course, this doesn't work because zsh passing the string inside
$temp as a single argument to the program, instead of parsing it for
words. From the man page, it sounds like ${^temp} or ${=temp} should
work, but neither does.
- --
"Restore your inalienable human rights. Jack McKinney
Vote Libertarian. http://www.lp.org http://www.lorentz.com
http://www.harrybrowne2000.org
F4 A0 65 67 58 77 AF 9B FC B3 C5 6B 55 36 94 A6 jackmc@lorentz.com
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBOecuukZx0BGJTwrZAQH/6AP/bVpZf0bL4rivlVLVAaSeI+DHbq4z5860
qx6RxhNJWOZSfmlv00F+XrVG6iOogr8tQ9V74QkIY6MssA7QVmpOcFCYYIdyfu9V
RFftK1PgvcUzwAO+qUmzpWySjxMWAuYY5Wr5UYJQjg/mmpwVDZ/fWY9DW4Wnrshn
pwrS9eRgUEE=
=u3lq
-----END PGP SIGNATURE-----
next reply other threads:[~2000-10-13 15:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-10-13 15:48 Jack McKinney [this message]
2000-10-13 16:16 ` Nemeth Ervin
2000-10-13 18:23 ` Bart Schaefer
2000-10-13 20:02 ` Jack McKinney
2000-10-13 19:53 ` Jack McKinney
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=20001013104819.A32478@stocks.pillory.com \
--to=jackmc-zsh-users@lorentz.com \
--cc=zsh-users@sunsite.auc.dk \
/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).