title: While Do Statement with blank/empty grep return?
body: <p>This is the code for my foobar.sh:</p>
  
  <pre><code>!#/bin/bash
  while [ 1 ]
  do
      pid=`ps -ef | grep "mylittleprogram" | grep -v grep | awk ' {print $2}'`
      echo $pid
      if [ "$pid"="" ]
      then
              echo "Process has ended lets get this show on the road..."
              exit
      else
              echo "Process has not ended yet"
      fi
      sleep 6
  done
  </code></pre>
  
  <p>I'm basically running a infinate loop which will execute command X once a monitored process has ended but I end up getting the following message as my script loops:</p>
  
  <pre><code>./foobar.sh: line 7: [: missing `]'
  Process has not ended yet
  </code></pre>
  
  <p>Is there a way of making the script accept that zero feed back will trigger my 'Then' statement and execute command X since it is not liking the current method.</p>