title: Shell script - can't execute a particular console command on script
body: <p>I've a magento 2 installation on my centos 7 server, I need to create a script to execute some particular shell command from the console. 
  I've create a simple script that read a file, then It execute all command that I wrote on this file, then It remove the file.</p>
  
  <p>I don't know why, but if execute this script: <code>HTTP_HOST="&lt;mydomain&gt;" php bin/magento cache:flush</code> from the console the command is executed with success. If the same command is executed from my script I get this error: <code>HTTP_HOST="&lt;mydomain&gt;": command not found</code></p>
  
  <p>here my script: </p>
  
  <pre><code>#! /bin/bash
  
  #imposto il nome del file
  filename=command_to_exec.flag
  echo ""
  echo "-- Sto cercando il file: ${filename}"
  
  #cerco il file
  if [ -f $filename ]
  then
      #file trovato
      echo "-- File Trovato..."
  
      #ciclo il file per leggere i comandi
      while read line
          do
          $line
      done &lt; $filename
  
      #elimino il file
      rm $filename
      echo "File Eliminato"
  
      #complete!
      echo "-- Procedura Completata"
  else
      #file NON trovato
      echo "-- File NON Trovato"
  fi
  </code></pre>