需要中止一个Perl脚本(使它死亡)-来自另一个脚本. [英] Need to abort a perl script (make it die) - from another script.

查看:191
本文介绍了需要中止一个Perl脚本(使它死亡)-来自另一个脚本.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要中止另一个脚本在后台运行的Perl脚本.

I need to abort a Perl script which is running in the background from another script.

许多perl脚本在我们的计算机上运行.我需要根据要求中止其中之一.我只知道要中止的perl脚本的名称.我需要中止该特定脚本,而又不影响其他进程.

Many perl scripts run on our machine. I need to abort one of the them on request. All I will know is the name of the perl script to abort. I need to abort that one particular script without affecting other processes.

我尝试使用PID/图像名称将其杀死,但由于以下原因,该方法不起作用

I tried killing it using PID/Image Name but it did not work for the below reasons,

1)我不知道脚本的PID(因为它是从触发器运行的)

1)I do not know the PID of the script (as it runs from a trigger)

2)该脚本在后台运行,因此映像名称始终为perl.exe,因此,如果使用映像名称,它也会杀死所有其他perl任务.

2)The script runs in the background, so the image name is always perl.exe and hence if image name is used , it kills all the other perl tasks as well.

我试图从"Windows标题"中获取perl脚本名称,并因此获得相应的PID,但始终显示为"NA".

I tried to get the perl script name from the 'windows title' and hence the corresponding PID, but it always shows 'NA'.

我什至试图删除perl脚本(因为我知道名称和位置),但是它也无法正常工作,因为它会从内存中运行整个脚本(即使已删除)

I even tried to delete the perl script(as I know the name and location) but it also did not work, as it runs the entire script from the memory (even though it is deleted)

请提供一些选项来帮助我从另一个脚本中终止正在运行的perl.

Please help me with some options to kill the running perl, from another script.

推荐答案

您的脚本可能会将其pid写入特殊文件,以供另一个脚本使用.

Your script may write its pid to special file for another script to use.

这篇关于需要中止一个Perl脚本(使它死亡)-来自另一个脚本.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆