title: PHP exec with grep using a variable passed?
body: <p>I am sure there is an easy answer , but i searched and could not find. </p>
  
  <p>I am basically trying to pass a variable to exec grep into a file</p>
  
  <p>so </p>
  
  <pre><code>exec("snmpget -v 2c -c public $host $oid_model | cut -d':' -f4 | sed -e 's/^[ ]*//'", $model);
  exec("grep $model /home/user/test.txt  |  cut -d':' -f1 | sed -e 's/^[ ]*//'", $new_model);
  </code></pre>
  
  <p>when printing my $model i get the output, when trying $new_model it does not. </p>