Operating System - Linux
1754355 Members
4748 Online
108813 Solutions
New Discussion юеВ

Re: monitor a launched process and get it exit status

 
SOLVED
Go to solution
totoperdu
Frequent Advisor

monitor a launched process and get it exit status

Hello,

i'd want to monitor a process but i don't know how.
i have thought to that:

$PROCESS >/dev/null 2>&1 & ; echo $$>/tmp.$PROCESS.pid

but in this case, i have not the exit status of $PROCESS.

someone can help me ?

thanks in advance.
2 REPLIES 2
Peter Godron
Honored Contributor
Solution

Re: monitor a launched process and get it exit status

Hi,
the way I see it you have two options:
1. use wait See http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=1046051

2. change your code to move your $PROCESS into another script and then call the script with &
e.g.
.
.
.
a.sh &
.
.
where a.sh is:
$PROCESS > /dev/null 2>&1
echo $!

Also: your profiles shows 1 point allocation for 9 answers !
totoperdu
Frequent Advisor

Re: monitor a launched process and get it exit status

many thanks Peter Godron,

you have gived me the good answers.

PS: i have corrected the missed allocation points ;)

Cheers,
Cedrick Gaillard