title: Redirect output of tar command to a variable in shell script
body: <p>I am untaring a .tar.gz file and redirecting the output to a variable. But it gives me an error while doing this operation.</p>
  
  <pre><code>old_file =$(tar -tvzf $node | head -2 | tail -1 | cut -f4 -d "/")
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code> old_file: command not found
  </code></pre>
  
  <p>But if run this command in terminal I am getting some output.</p>
  
  <p>Unable to figure out, if tar file redirection works or not?</p>