Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 'for' loop question



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