title: How to store output from a remote host in a variable bash script
body: <p>I need to get all the wars on a remote tomcat server printed via my bash script.
  I am able to ssh on the remote server and execute the command to get wars with version :- </p>
  
  <pre><code>${SSH} ${DEST_USER}@${DESTHOST} "Command"
  </code></pre>
  
  <p>however if I am storing it in a variable I don't get any-thing:-</p>
  
  <pre><code>output=${SSH} ${DEST_USER}@${DESTHOST} "Command"
  echo $output
  </code></pre>
  
  <p>Based on a bit research if I try it as</p>
  
  <pre><code>output=$(${SSH} ${DEST_USER}@${DESTHOST} "Command"
  echo $output
  </code></pre>
  
  <p>I got my output stored (need to understand why?).</p>
  
  <p>Secondly the output I got in a single line as:</p>
  
  <pre><code>abc_1.2.war ijk_2.2.war hij_3.2.war xyx_5.1.war
  </code></pre>
  
  <p>how can I format this output some thing like:</p>
  
  <pre><code>Name version
  abc  1.2
  ijk  2.2
  hij  3.2
  xyz  5.1  
  </code></pre>