title: Unix : saving a sed command in a variable, to echo it, then execute it
body: <p>I would like to execute a (for example <code>sed</code>) command and <code>echo</code> it before it is executed.</p>
  
  <p>I tried to save the command in a variable.<br>
  Then, <code>echo</code> it and execute it:</p>
  
  <pre><code>command="sed -i 's/FOO/BAR/g' myFile";
  echo "Command: \"$command\"" ;
  $command ;
  </code></pre>
  
  <p>Error I got : </p>
  
  <pre><code>Command: "sed -i 's/FOO/BAR/g' myFile"
  sed: -e expression #1, char 1: unknown command: `''
  </code></pre>
  
  <p><strong>How should I escape the single quotes?</strong> (or may I use double quotes ?)</p>
  
  <p>I googled it, but found no answer.</p>