title: How to test if a process exists in Bash?
body: <p>I want to make sure <code>node</code> is running when logging in. So in my <code>.bashrc</code> file I have:</p>
  
  <pre><code>pkill node
  sleep 1
  node server.js &amp;
  </code></pre>
  
  <p>Of course, that doesn't check if <code>node</code> is running... it simply kills it and starts it up again. Instead I'd like something like this:</p>
  
  <pre><code>node_process = $(pidof node)
  if [not_exists node_process]; then
    node server.js &amp;
  fi
  </code></pre>
  
  <p>The problem is the <code>not_exists</code> method doesn't seem to exist :). How do I test the existence of a number or string in Bash and is this the best way to ensure node is up and running upon login?</p>