title: Log in to another server and run commands - Using a script
body: <p>I want to run a script a.sh that will do the following steps - </p>
  
  <ol>
  <li>Run few commands</li>
  <li>Call another shell script b.sh in the same server - server01</li>
  <li>b.sh will login to another server - server02 and run the commands that follow.</li>
  </ol>
  
  <p>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.</p>
  
  <p>Have a look at the two scripts.</p>
  
  <p>a.sh</p>
  
  <pre><code>cd ~/sample/home &amp;&amp; python helloworld.py
  #!/bin/bash
  cd ~/sample/ &amp;&amp; ./b.sh
  </code></pre>
  
  <p>b.sh</p>
  
  <pre><code>ssh username@server02.com
  echo "In server02"
  </code></pre>
  
  <p>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".</p>
  
  <p>I am able to do till ssh to server02. After that it is not printing "In server02" in server02.</p>
  
  <p>Is there a way to do it?</p>