John T. Williams wrote:
ps -A | grep -e "[ /]python2.1\>" 1> /dev/null 2> /dev/null
A quick short-cut for the last part:
ps -A | grep -e "[ /]python2.1\>" >/dev/null 2>&1
"1" (stdout) is used by default, and then 2>&1 takes "2" (stderr) and
sends (>) it to the same location (&) as "1".
--
Kees
Thanks very much, works great :)
Tim
> -Message d'origine-
> De : John T. Williams [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 28 juillet 2003 15:14
> À : [EMAIL PROTECTED]; [EMAIL PROTECTED] Kernel. Org
> Objet : Re: Is a process running ?
>
>
> So
Message -
From: "Tim Fletcher" <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED] Kernel. Org" <[EMAIL PROTECTED]>
Sent: Monday, July 28, 2003 2:20 AM
Subject: Is a process running ?
>
> Hi all,
>
> i would like to write a simple shell script that checks f
Hi all,
i would like to write a simple shell script that checks for the existence of a certain
programme, in this case python2.1. if the
programme is active, do nothing, if not, start it.
i did think of doing a ps -A |grep python2.1, but then i have no idea how to
intergrate that in the shell