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

Re: Unable to process a for loop as expected??



On Sun, 18 Aug 1996 dpd@xxxxxxxx wrote:

> -------------------------------------------------------------
> #!/bin/zsh
> 
> list="a b c d"
> 
> for character in $list
> do
>    echo "Character is $character"
> done
> --------------------------------------------------------------

2 quick solutions

1) use "for character in a b c d e f g"

2) use "for character in `echo $list`

For some reason zsh seems to think that you're passing it only one 
argument to the for statement.

Tom


                                           ?
                                         ''~``
                                        ( o o )
+----------------------------------.oooO--(_)--Oooo.------------------------+

   mailto:tkaczma@xxxxxxx
                           http://orion.it.luc.edu/~tkaczma
                                     .oooO                  (312) 512-7302
                                     (   )   Oooo.
+-------------------------------------\ (----(   )--------------------------+
                                       \_)    ) / 
                                             (_/



Messages sorted by: Reverse Date, Date, Thread, Author