Skip to main content
1 of 2
Djidiouf
  • 201
  • 2
  • 6

The --exact attributes proposed in Hauke's answer didn't work on some systems. You can use the -x attribute instead.

#!/bin/bash if pgrep -x "zeal" > /dev/null then echo "Running" else echo "Stopped" fi 
Djidiouf
  • 201
  • 2
  • 6