title: How can I execute a command stored in a variable?
body: <p>What is the correct way to call some command stored in variable?</p>
  <p>Are there any differences between 1 and 2?</p>
  <pre><code>#!/bin/sh
  cmd=&quot;ls -la $APPROOTDIR | grep exception&quot;
  
  #1
  $cmd
  
  #2
  eval &quot;$cmd&quot;
  </code></pre>