title: Bash Script not executing command
body: <p>I have a bash script that is supposed to check for a running instance of a program and if its not running execute a command (echo for testing purposes). The problem is, that bash isn't executing the command even though it works when I copy/paste the command directly to the command line. I imagine my issue is simple and caused by my naivety with the script language. </p>
  
  <p>The line in question:</p>
  
  <pre><code>ps -ef | grep -v grep | grep $SCRIPT &gt; /dev/null || echo "`date` - $0 : $SCRIPT stopped. Restarting..."
  </code></pre>
  
  <p>If I paste it to the command line it works perfect, but when I run my script nothing happens. Suggestions?</p>
  
  <p>EDIT: I believe I've resolved the issue. The script that is run to check the <code>queue_reader.sh</code> script I foolishly named <code>check_queue_reader.sh</code>" so the <code>ps -ef</code> command was finding itself preventing the <code>||</code> from executing.</p>