Re: passing array to command line argument.

2008-12-12 Thread Andreas Schwab
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.

Re: passing array to command line argument.

2008-12-11 Thread Chet Ramey
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

Re: passing array to command line argument.

2008-12-09 Thread Andreas Schwab
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

Re: passing array to command line argument.

2008-12-09 Thread Dolphin06
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.

Re: passing array to command line argument.

2008-12-09 Thread Dolphin06
> -- > ``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.

Re: passing array to command line argument.

2008-12-09 Thread Stephane Chazelas
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

Re: passing array to command line argument.

2008-12-09 Thread Chet Ramey
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

Re: passing array to command line argument.

2008-12-09 Thread Dolphin06
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:

Re: passing array to command line argument.

2008-12-09 Thread Chet Ramey
> > 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

passing array to command line argument.

2008-12-09 Thread Dolphin06
;; 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.