Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Just use if ! pidof /usr/bin/Xvfb; then : do something; fi Commented Apr 28, 2016 at 1:51
  • I tried "if ! pidof /usr/bin/Xvfb; then : Xvfb :0 -screen 5 1024x768x8 &; fi" and got the error, "syntax error near unexpected token `;'". Commented Apr 28, 2016 at 2:24
  • Should be if ! pidof /usr/bin/Xvfb; then Xvfb :0 -screen 5 1024x768x8 & fi" if you want to run command in background. Commented Apr 28, 2016 at 2:28
  • if ! pgrep Xvfb; then ... should do the trick. Commented Apr 28, 2016 at 2:44