stopping a perl script
Hi,
I am experimenting with a perl script run from the command prompt and looping in the background. This is working fine. But as I am tweaking the perl script I need to be able to restart it. When I try this I get the message: Address already in use How can I stop the script that is currently running in order to test the new one? Thanks, Ron |
ps -ef
will give you all the processes currnetly running on your system with their PID's, just grep the script from it ps -ef | grep -i script_name | grep -vv grep use kill -9 process id (PID) to kill it P.S. if the script is just used to run a job at background something like system ("mozilla &"); then you should grep out the background process in this case mozilla and kill it. |
killall perl_script_name
Before diving into Perl you should learn the basic of Unix administration srtarting with this how to: http://tldp.org/HOWTO/DOS-Win-to-Linux-HOWTO.html And moviing on to these: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html http://tldp.org/LDP/abs/html/ |
Quote:
ie. $ my_scipt.pl & $ fg $ my_script.pl; [Cntrl]+c |
You guys are quick! :)
I just found out about kill. But then I thought how to get the matching process process number so thanks for that tip NEO77777 Thanks for those links and especially that last tip, Pickledbeans. Makes things easier! Ron |
Your more than welcome :)
|
All times are GMT -5. The time now is 10:25 PM. |