* 2011-07-07T07:13:24+02:00 * Javier Barroso wrote:

> On Thu, Jul 7, 2011 at 5:22 AM, Kamaraju S Kusumanchi
> <raju.mailingli...@gmail.com> wrote:
>> Consider the following shell script

>> #! /bin/sh

> You can use array variables if you want:
>
> names=("kama" "raju" "k a m a")
> for i in "${names[@]}"

Yes, but not with /bin/sh. OK, it's usually possible to just change the
interpreter to /bin/bash, but with /bin/sh the $@ array can be used:

    $ set -- "first item" "second item"
    $ for i in "$@"; do echo "$i"; done
    first item
    second item


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87liwaze2z....@mithlond.arda

Reply via email to