[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash: finding if mozilla is running



On Sat, Jul 26, 2003 at 10:22:53AM +0100, David selby wrote:
> Writting a small script to make mozilla show the results of HTML code 
> written in vi, when vi saves, the script  automaticly changes mozilla to 
> show that HTML.
> 
> I need to know if mozilla is running, if not I need to call it first ... 
> seemed simple
> 
> if ! ps ax | grep "mozilla-bin" &>/dev/null; then
>        /usr/local/mozilla/mozilla -P web &
>        .....
[...]
> Ie its picking up on the grep process, finding "mozilla-bin", saying yep 
> its running, dont call mozilla & bang, script fails.

ps --no-headers -C "mozilla-bin" | grep -q -- "-bin"

-- 
Seneca
seneca-cunningham@rogers.com

Attachment: pgpNVxSL9uPj1.pgp
Description: PGP signature


Reply to: