Chet Ramey writes:
> Dolphin06 wrote:
>> I dont get it right, i always display only the first one, and i dont know how
>> to write a scalar variable.
>> I tried like this :
>> ssh $u...@$server script2 -f "${my_arr...@]}"
>
> Stick an `echo' in front of this command and see what you're executing.
Dolphin06 wrote:
> I dont get it right, i always display only the first one, and i dont know how
> to write a scalar variable.
> I tried like this :
> ssh $u...@$server script2 -f "${my_arr...@]}"
Stick an `echo' in front of this command and see what you're executing.
--
``The lyf so short, the
Dolphin06 <[EMAIL PROTECTED]> writes:
> I dont get it right, i always display only the first one, and i dont know how
> to write a scalar variable.
> I tried like this :
> ssh [EMAIL PROTECTED] script2 -f "[EMAIL PROTECTED]"
This passes every element of my_array as a separate argument. Also, ssh
gt; which would work the same in bash, ksh93 and zsh (and in zsh, it
> wouldn't discard the empty elements, contrary to $my_array).
>
> --
> Stéphane
>
>
>
>
--
View this message in context:
http://www.nabble.com/passing-array-to-command-line-argument.-tp20914576p20918475.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>
> Chet Ramey, ITS, CWRU[EMAIL PROTECTED]
> http://cnswww.cns.cwru.edu/~chet/
>
>
>
>
--
View this message in context:
http://www.nabble.com/passing-array-to-command-line-argument.-tp20914576p20916101.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.
On Tue, Dec 09, 2008 at 09:14:51AM -0500, Chet Ramey wrote:
> >
> > 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
Dolphin06 wrote:
> Hello,
> So how can i pass the entire array, i m new to shell scripting so i do not
> really understand when you talk about unsubscripted word expansion
Since programs only take a list of strings as arguments, you have to expand
the array to a list of values. The "[EMAIL PROTEC
to the first element of an array.
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>
> Chet Ramey, ITS, CWRU[EMAIL PROTECTED]
> http://tiswww.tis.case.edu/~chet/
>
>
>
>
--
View this message in context:
>
> 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
;;
esac
done
echo "arr : [EMAIL PROTECTED]"
--
View this message in context:
http://www.nabble.com/passing-array-to-command-line-argument.-tp20914576p20914576.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.
10 matches
Mail list logo