Consider I have two servers A and B.
And on the server B, I have a script test.sh
.
I want to execute this test.sh
from server A using FTP connection between them and also I want to pass a variable to the script of B but the variable is defined at A.
OR
If I SSH to server B from A, just after ssh command , i will execute the shell script at B. But if i want to add a variable (that i have defined while i was at A) as an argument to script of B. how would i do it ? any suggestion ?
Please suggest.
Thanks in advance.
Without seeing your code is difficult to see what you are trying to do exactly, but if you use double quotes your variable should be interpolated before send the value of it to the remote host, ex:
Some, but not many, FTP servers support
SITE EXEC command
.In the common *nix
ftp
client, you can usequote
command to execute theSITE
FTP command:But this will probably not work with your server. In most cases, you won't be able to execute a shell command over FTP.
Though if you have an SSH/shell access, use the
ssh
to execute the script.