From: tejal.acharya@gmail.com on
Hey I am new to the group..and to korn scripting....I have a script
that starts a process....i want to periodically check the status of my
process and output to the screen ' I am running'

How would i do that...
Tejal

From: Stephan Brönnimann on
tejal.acharya(a)gmail.com wrote:
> Hey I am new to the group..and to korn scripting....I have a script
> that starts a process....i want to periodically check the status of my
> process and output to the screen ' I am running'
>
> How would i do that...
> Tejal

Send the process to the background and use $! to see if the process
still exists:
#! /bin/sh

cmd="echo start; sleep 3; echo done"
chktime=1

(eval $cmd)&

pid=$!
while ps -p $pid >/dev/null 2>&1
do
echo "'$cmd' running"
sleep $chktime
done

Stephan