I have written one script on lets say server1
and from that script I want to execute script Start_UI_AdminApp.sh
on server2
through ssh. I also need to pass the arguments while executing this ssh command. So that i have to use those arguments in sc.sh
. This is my script which I am trying to execute
I am calling my server1 script as below
./server1.sh 3005 BuildNO_7
Below is my script from server1
(server1.sh
)
#!/bin/bash
port=$1
directory=$2
ssh user@server2 "bash -s" < /home/server/scripts/Start_UI_AdminApp.sh "$port $directory"
echo "Script executed"
This is the error which I am getting when executing the command ./server1.sh 3005 BuildNO_7
./server1.sh: line 4: /home/server/scripts/Start_UI_AdminApp.sh: No such file or directory
Script executed