* 'for' loop question
@ 1998-02-25 20:44 Timothy J Luoma
1998-02-25 21:22 ` Thomas Koehler
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Timothy J Luoma @ 1998-02-25 20:44 UTC (permalink / raw)
To: zsh-users
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
TjL
--
"It takes real courage to be a Macintosh user; it takes real
conviction; not unlike being a Christian in the days of the Romans."
- Guy Kawasaki, Chief Evangelist for Apple Computer - from "Hotseat"
interview with John McChesney (3/28/97) [ my birthday! ]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 'for' loop question
1998-02-25 20:44 'for' loop question Timothy J Luoma
@ 1998-02-25 21:22 ` Thomas Koehler
1998-02-25 21:23 ` Bart Schaefer
1998-02-25 21:47 ` Greg Badros
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Koehler @ 1998-02-25 21:22 UTC (permalink / raw)
To: zsh-users
On Wed, Feb 25, 1998 at 03:44:14PM -0500, Timothy J Luoma wrote:
>
> 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 this:
SERVERS=(rs.internic.net whois.arin.net whois.ripe.net whois.apnic.net whois.nic.mil)
for i in $SERVERS ; do echo $i ; done
CU,
Thomas
--
Thomas Köhler Email: jean-luc@picard.franken.de
<>< WWW: http://home.pages.de/~jeanluc/
IRC: jeanluc
LCARS --- Linux for Computers on All Real Starships
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 'for' loop question
1998-02-25 20:44 'for' loop question Timothy J Luoma
1998-02-25 21:22 ` Thomas Koehler
@ 1998-02-25 21:23 ` Bart Schaefer
1998-02-25 21:47 ` Greg Badros
2 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 1998-02-25 21:23 UTC (permalink / raw)
To: Timothy J Luoma, zsh-users
On Feb 25, 3:44pm, Timothy J Luoma wrote:
> Subject: 'for' loop question
>
> 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"
Remember SH_WORD_SPLIT!
> for i in $SERVERS
> do
for i in $=SERVERS
do
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 'for' loop question
1998-02-25 20:44 'for' loop question Timothy J Luoma
1998-02-25 21:22 ` Thomas Koehler
1998-02-25 21:23 ` Bart Schaefer
@ 1998-02-25 21:47 ` Greg Badros
2 siblings, 0 replies; 4+ messages in thread
From: Greg Badros @ 1998-02-25 21:47 UTC (permalink / raw)
To: Timothy J Luoma; +Cc: zsh-users
Timothy J Luoma <luomat+Lists/Zsh/users@luomat.peak.org> 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@cs.washington.edu
Seattle, WA USA
http://www.cs.washington.edu/homes/gjb
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-02-25 21:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-25 20:44 'for' loop question Timothy J Luoma
1998-02-25 21:22 ` Thomas Koehler
1998-02-25 21:23 ` Bart Schaefer
1998-02-25 21:47 ` Greg Badros
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).