passing array to command line argument.

2008-12-09 Thread Dolphin06
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 script2: while getopts ":f:" opt ; do case $opt in f ) arr="$OPTARG" ;; esac done echo "ar

Re: passing array to command line argument.

2008-12-09 Thread Dolphin06
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 Thank you for helping. Chet Ramey wrote: > >> >> Hello i would like to pass an array to my script command line argument, >> but >> only the first

Re: passing array to command line argument.

2008-12-09 Thread Dolphin06
both arrays. Chet Ramey wrote: > > 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 string

Re: passing array to command line argument.

2008-12-09 Thread Dolphin06
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]" It's not changing anything. I m using bash. Thank you. Stephane Chazelas wrote: > > On Tue, Dec 09, 2008 at 09:14:51

how to know if a command was successful on remote server

2008-12-10 Thread Dolphin06
Hello i m sending command to remote server, in my script on my local machine. I would like to know how can i return a value if the command on the remote server failed. on my script on local machine : #! /bin/bash #how can i get a returned value from this ? ssh [EMAIL PROTECTED] remotescript para

command not found on remote server

2008-12-11 Thread Dolphin06
Hello all, Some script on the remote server are called in .bash_profile, so they are accessible for the user. But when i send a command via ssh, and that my command call those script, it says command unknown... What can i do for it to work ? Thank you. -- View this message in context: http://w

Re: command not found on remote server

2008-12-11 Thread Dolphin06
Can i do something like this : ssh [EMAIL PROTECTED] export PATH=$PATH:/other path/ ; script param right ? Chet Ramey wrote: > > Dolphin06 wrote: >> Hello all, >> >> Some script on the remote server are called in .bash_profile, so they are >> accessible fo

Formating variable with caracter and date.

2008-12-12 Thread Dolphin06
Hello all, I would like to give a variable a value which have a format like this one: <3 letters>-- should be yymmdd. Date of the day by default. How would i do this, i know the date command is date +"%y-%m-%d", but i dont know the syntax for mixing letters date and digit into one variable. Als