LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   passing parameters from a unix shell prompt into a windows cmd.exe prompt (http://www.linuxquestions.org/questions/programming-9/passing-parameters-from-a-unix-shell-prompt-into-a-windows-cmd-exe-prompt-751825/)

nano2 09-01-2009 12:21 PM

passing parameters from a unix shell prompt into a windows cmd.exe prompt
 
Hi ,

I have the following scenario where I have a shell script and I need to pass 2 parameters into a windows command .

#!/bin/sh
param1=$1
param2=$2

ssh <windows ip address> <<EOF

set param1_value=%param1%
set param2_value=%param2%
copy %param1_value% %param_value_2%
exit

EOF

when it goes into the windows machine it doesn't know %param1% nor %param2%

Does anyone have any suggestions .

Thanks inadvance

catkin 09-01-2009 12:26 PM

Try
Code:

#!/bin/sh
param1=$1
param2=$2

ssh <windows ip address> <<EOF

set param1_value="$param1"
set param2_value="$param2"
copy %param1_value% %param_value_2%
exit

EOF

Will not work if there are whitespace characters in the values of $1 and $2


All times are GMT -5. The time now is 07:01 PM.