I want to run a script a.sh that will do the following steps -
- Run few commands
- Call another shell script b.sh in the same server - server01
- b.sh will login to another server - server02 and run the commands that follow.
I am able to do till step 2 correctly. In step 3, I am able to loin to another server but it stops there. It does not run the steps that follow.
Have a look at the two scripts.
a.sh
cd ~/sample/home && python helloworld.py
#!/bin/bash
cd ~/sample/ && ./b.sh
b.sh
ssh username@server02.com
echo "In server02"
Both a.sh and b.sh are in the same server, that is server01.com. Here, I want a.sh to run in server01 and then b.sh to run in server01. Once b.sh runs, it should do ssh to server02 and print "In server02".
I am able to do till ssh to server02. After that it is not printing "In server02" in server02.
Is there a way to do it?