I'm running a scripts that launches remotely another script with ssh. Here's the script:
ssh user@remote "~/script1.sh"
ssh user@remote "~/script2.sh"
Here's the remote script:
When I run the main.sh, the script1.sh and script2.sh will be launched. But what I want, is that the main.sh must run script2.sh only after script1.sh ends. What is happening, is that, the main.sh don't wait for script1.sh to ends before run script2.sh.
How can I add this capability?