How to tell if a certain program is running?

Nicolai Spohrer nicolai_spohrer at gmx.de
Fri Jul 6 13:28:03 UTC 2007


What about something like

[code]
#!/bin/bash
RUNNING=$(ps -A | grep firefox | wc -l)
if [ "$RUNNING" -ge "1" ]; then
echo "Firefox is running"
else
echo "Firefox is not running"
fi
exit 0
[/code]

?

greetings

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070706/c7a2e4d1/attachment.sig>


More information about the ubuntu-users mailing list