Re: how to test whether a program is running?
- Posted by Alexander Toresson <alexander.toresson at gmail.com> Jun 04, 2005
- 478 views
Jerry Story wrote: > > Mario Steele wrote: > > > > Jerry Story wrote: > > > > > > How can I test whether a program is running? > > > For example how can I test whether Mozilla is running? > > > > > > > It depends on what Operating System you are refering to. Windows or Linux. > > First Linux. Then later maybe Windows, so the program will work on both > Linux and Windows. > If you run "mozilla &", you'll get a pid, alongside a few other things written into standard output... Then you can use ps to check what programs are running and their pid... I'm not 100% sure how it'd be done, try redirecting the output from "mozilla &" to a file, and check the man page of ps... but you'll have to poll the output of ps in regular intervals... I can't check it either, I'm going away for the weekend and I don't have access to linux atm. I hope this will help. Regards, Alexander Toresson