Operating System - HP-UX
1833784 Members
4892 Online
110063 Solutions
New Discussion

Re: command "while ... do ... done"

 
SOLVED
Go to solution
iranzo
Frequent Advisor

command "while ... do ... done"

Hello,
here my script :

# Function
KillProcX()
{
/sbin/init.d/xvfb stop
sleep 5
/sbin/init.d/xfs stop
# process X kill
ps -ef|grep X|grep -v grep|awk '{print $2}'|while read PID
do
kill -15 $PID
done
}
ServerXstart()
{
/sbin/init.d/xfs start
sleep 5
/sbin/init.d/xvfb start
}

# Function execute
KillProcX
ServerXstart

When i execute this script, it's exit
at the end "KillProcX" function and not
execute "ServerXstart" function.

Thank's a lot.
Bonjour
1 REPLY 1
Chris Wilshaw
Honored Contributor
Solution

Re: command "while ... do ... done"

Does the name of the script you are running contain an X ?

If so, the script it probably killing itself.