I guess permissions and placements of pidof differ between distros. Most other infosomething files, however, are made with pidof as I saw. Perhaps they should all be changed?
The line you propose should be "ps -A | grep amarok | grep -v grep | wc -l" I think (and again, compared with 0). If the "grep -v grep" part isn't there, it will return a line because "grep amarok" is running.
I still don't know if that would work for everyone. Let billiob see. :p
True. At least for me pidof won't work.
This does work, no need for grep -v or wc -l:
$ if ps -C wish8.5 > /dev/null; then echo "yep is running"; fi
But then again, the -C might also be platform specific.
Even another way is to use a regular expression that enforces the command to start with amarok,
then you won't need the "grep -v grep".
Anyways, I'm not a shell expert, don't know the best way to do this.
Edit : or $ pgrep wish8.5 -- gosh there are lots of ways to do this