![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
ececute scrtipt over ssh
Hi all,
I have a script which I want to launch from on a remote machine. I tied to do this. I have 2 requirement 1) To retain the "BUILDDIR" value when connected to SSH of sna3. 2) execute a script 'test.sh' present in my local directory on remote sna3 machine. If I am using Single Quotes, I am not able to retail the BUILDDIR value. MAIN Script file: BUILDDIR=$PWD ssh sna4 " echo pwd; echo test.script -------------------------- ./test.sh " How do I do this Mukund Jampala |
|
||||
|
Hi
1) Unless you include the variable in a script run on the remote machine it won't be used. You are creating the variable locally, so the remote machine won't be aware of it. 2)The script won't be run the way you have things formatted. You have the command to run test.sh in double quotes. Scripts don't execute if they're in double quotes because the shell will see them as just text. If you want to echo text to the screen, just put the commands in the script. Then run ssh sna4 test.sh Hope this helps. Todd |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|