title: adb shell running multiple commands from same cmd window
body: <p>I am trying to create a <code>Perl</code> script to run set of commands through <code>adb shell</code>.</p>
  
  <pre><code>cmd1 
  cmd2 
  cmd3 
  cmd3(1)
  </code></pre>
  
  <p>I put all the commands in a text file and ran it like this: <code>adb shell &lt; adb_commands.txt</code>.(<a href="https://stackoverflow.com/a/25045657/4905577">reference</a>)</p>
  
  <p>However, I have this one issue where the last command cmd3(1) needs to be executed from within the previous command cmd3.<br>
  So cmd3 will be executed and will wait for cmd3(1) to be entered. This is not happening coz as far as i can tell, <code>adb shell</code> is waiting for cmd3 to finish so it can run cmd3(1). </p>
  
  <p>Can someone please advise on how to solve this issue or if there are any alternate ways to do this?</p>
  
  <p>Thanks.</p>