Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send an abort or escape character??

Status
Not open for further replies.

mediation

Technical User
Nov 11, 2006
17
Dears,

I have a script which runs another one during its excution and puts the o/p of the second one in a file .. i cannot terminate this (child) script from my script .. i need to send a escape character or abort signal through my script to terminate the one running and continue in my script ..

so can any one help me ???
Thanks in advance for your help ..

Regards,
 
Not sure what the requirement is here, but surely an exit in the second script would do the job? If not, perhaps grab the PID of the child process (perhaps using ps -ef | grep scriptname and cut the PID from the list) and kill it within the first script.

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
You could obtain the PID using jobs -p? You would have to run the child script as a background process of course, I presume you are doing that already?

Annihilannic.
 
yes i was running it in the background ... i tried to kill the process and it works successfully .. problem has been solved.
Thanks guys for your help ..
but i was asking about how to put something like "^c" the interrupt signal in the main script to abort from the impeded one.
if anyone know how to do that it would be great.

Thank you again
regards,
 
kill -INT <pid> will send the same signal (SIGINT) to the process as if you hit Ctrl-C.

Annihilannic.
 
yes i was running it in the background
kill -2 $!

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top