From: "John T. Williams" <jtwilliams@vt.edu>
To: tfletcher@netfactoriel.com,
"Linux-Newbie@Vger. Kernel. Org" <linux-newbie@vger.kernel.org>
Subject: Re: Is a process running ?
Date: Mon, 28 Jul 2003 06:14:23 -0700 [thread overview]
Message-ID: <000701c3550a$41308a80$ed64a8c0@descartes> (raw)
In-Reply-To: NGBBLGNMLJPKEPIFPKLHKEEFGAAA.tfletcher@netfactoriel.com
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" <tfletcher@netfactoriel.com>
To: "Linux-Newbie@Vger. Kernel. Org" <linux-newbie@vger.kernel.org>
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 majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
next prev parent reply other threads:[~2003-07-28 13:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-28 9:20 Is a process running ? Tim Fletcher
2003-07-28 13:14 ` John T. Williams [this message]
2003-07-28 11:02 ` Tim Fletcher
2003-07-28 16:32 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000701c3550a$41308a80$ed64a8c0@descartes' \
--to=jtwilliams@vt.edu \
--cc=linux-newbie@vger.kernel.org \
--cc=tfletcher@netfactoriel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox