我必須遠程連接到一個網關(在Linux平臺上工作),其中有幾個可執行文件(signingModule.sh和taxModule.sh)。 現在我想在我的桌面上編寫一個腳本,它將連接到該網關,並在兩個不同的終端中運行signingModule.sh和taxModule.sh。如何在遠程機器上運行多個腳本
我已經寫了下面的代碼:
ssh [email protected] #to connect to gateway
sleep 5
cd /opt/swfiscal/signingModule #path of both modules
./signingModule #executable.
但是通過這個代碼,我能夠連接我的網關,但連接到網關後一無所獲正在發生的事情。
第二碼:
source configPath # file where i have given path of both the modules
cd $FCM_SCRIPTS # variable in which i have stored the path of modules
ssh [email protected] 'sh -' < startSigningModule** #to connect and run one module.
爲這樣的輸出我得到:
-source:用configPath:文件未找到
請幫我工作了這一點。提前致謝。
注:
- 我可以複製,如果需要粘貼在網關我的文件。
Gnome-Terminal
或任何相關的替代方案是不是在我的網關
你可以做這樣的事情。 ssh bar @ foo「command1 && command2」 –
它不能正常工作:( –
您是否收到任何錯誤? –