[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: passing array to command line argument.
From: |
Chet Ramey |
Subject: |
Re: passing array to command line argument. |
Date: |
Tue, 9 Dec 2008 09:14:51 -0500 |
>
> Hello i would like to pass an array to my script command line argument, but
> only the first element of the array is displayed. Here is my process :
>
> script1:
> my_array=(el1 el2 el3)
> script2 -f $my_array
You're only passing the first element of the array to script2. An
unsubscripted word expansion expands to the first element of an array.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU chet@case.edu http://tiswww.tis.case.edu/~chet/