Sponsored Content
Full Discussion: Process management
Top Forums UNIX for Dummies Questions & Answers Process management Post 232 by PxT on Monday 13th of November 2000 11:15:03 AM
Old 11-13-2000
Try something like:

Code:
#!/bin/ksh

ps -ef | grep [f]oo
if [ $? -eq 1 ]
then
	echo Process not running.
	# Restart process here
fi


Replace 'foo' with whatever your process name is. The
[ ] brackets around the first letter will stop grep from matching on itself.

HTH
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"Process management" question

This one will show how "wet behind the ears" I am but here it goes... Suppose my boss wants me to run an app every day from the command line. The command line statement looks like this: $> my_executable_program -my_parameter file > my_outfile Let's say that one day, I do this: $>... (1 Reply)
Discussion started by: alan
1 Replies

2. AIX

service/process management -autostart at startup

Hi, I want to modify some of the services/processes (related to the oracle database) to start automatically at the startup of the server. which commands may help me? which commands do I need to use? my server configuration is, in brief: hardware:IBM P550 / OS : AIX 5300 thanks,... (1 Reply)
Discussion started by: talipk
1 Replies

3. HP-UX

Unix process management

Hi guys, I want to learn the process management in unix deeply. I have looked for different commands here and there but I can't find a consolidated document or book, does anybody have a link to any book or something? Regards, Messi (1 Reply)
Discussion started by: messi777
1 Replies

4. What is on Your Mind?

Individual Risk Management (Personal IT Security) and Browser Cache Management

Original post from this thread on browser caching. To add to this, it is an effective security measure to clear absolutely all cached data (cookies, web content, ....) when closing the browser - i.e. in case of a shutdown. It takes a bit of work to re-login to all the sites but websites will not... (7 Replies)
Discussion started by: bakunin
7 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 03:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy