Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 'for' loop question
- X-seq: zsh-users 1344
- From: Greg Badros <gjb@xxxxxxxxxxxxxxxxx>
- To: Timothy J Luoma <luomat+Lists/Zsh/users@xxxxxxxxxxxxxxx>
- Subject: Re: 'for' loop question
- Date: 25 Feb 1998 13:47:27 -0800
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: Timothy J Luoma's message of "Wed, 25 Feb 98 15:44:14 -0500"
- References: <199802252044.PAA13635@xxxxxxxxxxxxxxx>
Timothy J Luoma <luomat+Lists/Zsh/users@xxxxxxxxxxxxxxx> writes:
> Can I do this in zsh? It doesn't seem to be working:
>
> SERVERS="rs.internic.net whois.arin.net whois.ripe.net
> whois.apnic.net whois.nic.mil"
>
> for i in $SERVERS
> do
Try either
# Make it a zsh array
SERVERS=(rs.internic.net whois.arin.net whois.ripe.net whois.apnic.net whois.nic.mil)
# or the original string based, but use sh_word_split modifier to expand
for i in $=SERVERS
# or setopt sh_word_split and then your original code will work
Good luck.
Greg J. Badros
gjb@xxxxxxxxxxxxxxxxx
Seattle, WA USA
http://www.cs.washington.edu/homes/gjb
Messages sorted by:
Reverse Date,
Date,
Thread,
Author