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 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