title: BASH: how to put variable inside regex?
body: <p>i'm trying to get working the following code:</p>
  
  <pre><code>searchfile="availables.txt"
  read searchterm
  grep_params="-i ^.*${searchterm}.*;.*$' $searchfile"
  egrep $grep_params
  </code></pre>
  
  <p>which should echo all lines beginning with the $searchterm and followed by ";". But if the searchterm contains spaces it doesn't work (eg: "black eyed peas"), it gives me the following output:</p>
  
  <pre><code>egrep: eyed: No such file or directory
  egrep: peas.*;.*$": No such file or directory
  egrep: "availables.txt": No such file or directory
  </code></pre>