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

Re: need help on shell programming



* Michael Pobega <pobega@gmail.com> 08.03.2009
 
> #! /bin/sh
> 
> if [ $(ps aux | grep script.sh | grep -v grep) ]; then
>  <your script here>

Hello Michael,

what about "pgrep"?

-----------------------------------------------------+
#! /bin/bash                                         |
                                                     |
if [ $(pgrep -x script.sh) ]; then <script here>; fi |
-----------------------------------------------------+

Just my 2¢
Michael

-- 
"Nowhere you can be that isn't where you were meant to be. It's easy."
       -- John Lennon

Attachment: signature.asc
Description: Digital signature


Reply to: