LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-01-2009, 11:21 AM   #1
nano2
Member
 
Registered: May 2007
Posts: 100

Rep: Reputation: 15
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
 
Old 09-01-2009, 11:26 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listing Created Users Via CMD Prompt Verbal Kint Linux - General 1 09-14-2006 06:54 PM
stuck in unix cmd prompt ddajango Linux - Newbie 3 10-11-2005 02:24 AM
Build 'n Debug a C/C++ KDevlop cmd prompt project SCOSWriter Linux - Software 2 12-10-2004 10:07 AM
passing java parameters to a unix script nephilim Programming 25 10-22-2003 10:51 AM
free quote @ cmd prompt rickenbacherus Linux - General 7 03-06-2003 11:01 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration