title: Execute command inside for loop from variable in bash
body: <p>Trying to run commands defined in variables inside a for loop:</p>
  
  <pre><code>somevar="Bit of text"
  cmd1="command \"search '$somevar' here\""
  cmd2="command \"search '$somevar' there\""
  for cmd in cmd1 cmd2 ; do
      eval \$$cmd
      ssh server1 eval \$$cmd
  done
  </code></pre>
  
  <p>I've put in the variations I have to consider such as the ssh inside the loop etc as these are needed in my script.  I think the eval is the right direction, but the way that the quotes inside the command get interpreted comes through wrong.</p>