title: Writing a script that gets command and executes it
body: <p>I want to write a script that gets in its argument a command and executes it while it's running. for example if the script called ex_script, writing</p>
  
  <pre><code>ex_script "cat file1.txt | wc -l"
  </code></pre>
  
  <p>and the ex_script is:</p>
  
  <pre><code>var=`"${1}"`
  echo $var
  </code></pre>
  
  <p>will assign the number of lines in <code>file1.txt</code> in <code>var</code> and then print it.</p>
  
  <p>But it gives me</p>
  
  <pre><code>./ex_script: line 3: cat file1.txt | wc -l: command not found
  </code></pre>
  
  <p>How do I write this correctly?</p>