Re: How to tell if a certain program is running?
- From: Zac Brown <rufius@xxxxxxxxx>
- Date: Sun, 08 Jul 2007 09:51:07 -0400
You could use pgrep which will return nothing if the process doesn't
exist and if it does, then it will return the process id(s).
Cheers,
Zac
Craig Hagerman wrote:
I am wondering if there is a simple way to programatically tell if a
given program is running. I want to write a bash script to check if a
program is running, then if not start it.
My first idea was to try to return grep the output from 'ps ax' but
even if a program isin't running grep will return the request you just
made. I am sure there is a more elegant way I don't know about.
Craig
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: How to tell if a certain program is running?
- From: Smoot Carl-Mitchell
- Re: How to tell if a certain program is running?
- References:
- How to tell if a certain program is running?
- From: Craig Hagerman
- How to tell if a certain program is running?
- Prev by Date: VNC programs
- Next by Date: Re: GoogleDesktop - After 48 hours its only at .1%
- Previous by thread: Re: How to tell if a certain program is running?
- Next by thread: Re: How to tell if a certain program is running?
- Index(es):