Something like this would do it

-------------------  pythstart.sh ----------------------
#!/bin/bash

ps -A | grep -e "[ /]python2.1\>" 1> /dev/null 2> /dev/null

if[ $? != 0]; then
    python2.1
fi

-----------------end pythstart.sh-----------------------





----- Original 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 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 script.
>
> any ideas would be very  welcome
>
> Thanks & HAND
> Tim
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to