Link to home
Start Free TrialLog in
Avatar of rahman
rahman

asked on

how do I pause execution of the korn shell script ?

I have a Korn shell script and I need to pause it while executing.  Is there any keyword that will allow me to pause execution until I hit a key and then execute the rest of the script??      
Avatar of rickyr
rickyr

type............
jobs
this will return a list of your current running processes.
do..........
fg %1
this will bring process number one to the foreground, now
type control-z this will pause it.
to start it running again do........
bg %1 this will start it off again in the background.
This works the same as the "c" shell.
regards
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Find the process id first.....
ps -ef | grep "process_name"

then, to pause it
kill -STOP process_id

to restart it.
kill -CONT process_id

You have to be root to manipulate processes you don't own.

regards
Avatar of rahman

ASKER

Thanks for all the help guys! :)
Avatar of rahman

ASKER

Thanks for all the help guys! :)