man pgrep

PGREP(1)        Linux User's Manual     PGREP(1)



NAME
        pgrep,  pkill  - look up or signal processes based on name
        and other attributes


SYNOPSIS
        pgrep [-flnvx] [-d delimiter] [-P ppid,...] [-g   pgrp,...]
        [-s   sid,...] [-u euid,...] [-U uid,...] [-G gid,...]
        [-t term,...] [pattern]

        pkill [-signal] [-fnvx] [-P ppid,...] [-g pgrp,...]
        [-s sid,...] [-u euid,...] [-U uid,...] [-G  gid,...]
        [-t term,...] [pattern]


DESCRIPTION
        pgrep  looks  through  the currently running processes and
        lists the process IDs which matches the selection criteria
        to stdout.  All the criteria have to match.  For example...



Clay Fandre wrote:
> On Thu, 25 Sep 2003, Lansing, Dan wrote:
> 
> 
>>Ok...perhaps I should have been more specific....i am familiar with chron, grep and ps....how would I combine these to write a script to do this??
>>
> 
> 
> #!/bin/sh
> 
> if ! ps -ef | grep <process name> | grep -v grep > /dev/null; then
> <restart process>
> fi
> 
> 
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> http://www.mn-linux.org tclug-list at mn-linux.org
> https://mailman.real-time.com/mailman/listinfo/tclug-list
> 
> 



_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list