* SoloCDM ([EMAIL PROTECTED]) wrote:
> How do I issue a command that will prevent two possible executed
> instances of the same program?
> 
> Note: Detailed Documentation(s) and Sample(s) are more than welcome.
>       When you reply to this message, please include
>       the mailing list and my address.
> 
> *********************************************************************
> Signed,
> SoloCDM

I assume you aren't writing a program yourself here, and want a script
to start a program, only if it isn't already running... (Your question
wasn't clear on that).

For example, we want to lauch only one copy of mutt.

My (slightly cheating and not at all thorough) way of doing it would be:

#!/bin/bash
[ -z `pidof mutt` ] && { mutt }

YMMV :)

Tom.
-- 
            .-------------------------------------------------------.
    .^.     | Tom Gilbert, England | [EMAIL PROTECTED] |
    /V\     |----------------------| www.tomgilbert.freeserve.co.uk |
   // \\    | Sites I recommend:   `--------------------------------|
  /(   )\   | www.freshmeat.net www.enlightenment.org slashdot.org  |
   ^^-^^    `-------------------------------------------------------'


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to