Sponsored Content
Top Forums Shell Programming and Scripting Perl script to kill the process ID of a command after a certain period Post 302375475 by durden_tyler on Friday 27th of November 2009 11:49:00 PM
Old 11-28-2009
Quote:
Originally Posted by Pouchie1
...
#!/usr/bin/perl
$i = <STDIN>;
$j = <STDIN>;
system("ping $i > ping.pl.txt");
system("sleep $j");
system("kill -9 `ps aux |grep ping|awk '{ print $2 }' ");
Ugh... That looks as out of place as Pavarotti in a Bon Jovi concert. Please do yourself a favor and use a shell script.

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to kill a process in perl

Hi friends, I have a perl script which needs to kill all java processes running on both windows and unix. currently I'm getting the OS and killing the process by using system. my code is: if ($os eq MSWin32) system("taskkill java"); else system("kill -9 java") Is there any way... (2 Replies)
Discussion started by: gurukottur
2 Replies

2. Shell Programming and Scripting

Perl : Kill process within 5 min

From a perl script , How can I monitor a PS which I activated and kill it within 5 minutes in case it didn't complete its tasks.:confused: (2 Replies)
Discussion started by: Alalush
2 Replies

3. Shell Programming and Scripting

Kill a process without using kill command

Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies

4. Linux

Kill a process without using kill command

I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies

5. Shell Programming and Scripting

Script to kill process...

hello Bros, I need to write some script that i can put it on crontab which checks for a process X if running. If the process X is ruuning then take the PID and kill it or display message that says process X is not running. I am using AIX 5.3 Thanks guys.:b: (2 Replies)
Discussion started by: malcomex999
2 Replies

6. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

7. Shell Programming and Scripting

Script to Kill a Process by Name...

Hello all... new to these forums and a bit of a newbie with linux aswell. I need to figure out how to write a shell script to kill a process by name as given to the script as an argument. I've got that part working OK, but i need to make sure that the script does not allow processes that are... (6 Replies)
Discussion started by: cannon1707
6 Replies

8. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

9. Shell Programming and Scripting

perl check and kill process

Hi All How can i in perl check for a running process and if it is running kill it the issue might be that there will be more than one of the same process and i want to kill all of them the process is below root 1944 1 0 16:28 ? 00:00:01 x11vnc -display :0... (3 Replies)
Discussion started by: ab52
3 Replies

10. Shell Programming and Scripting

Command to know all the Current running process and how to kill

All, 1.What is the unix comand used for all current running process (Including All current running processes Parent ->child->subchild process) 2.If child and subchild processes are running then what is the unix command to kill parent and its all child subchild processes in UNIX. Kindly... (7 Replies)
Discussion started by: skp
7 Replies
asadmin-jms-ping(1AS)						   User Commands					     asadmin-jms-ping(1AS)

NAME
jms-ping - checks to see if the JMS provider is up and running SYNOPSIS
jms-ping --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--passwordfile filename] [--secure|-s] [--terse=false] [--echo=false] [--interactive=false] Checks to see if the JMS provider is up and running. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --passwordfile file containing the domain application server password. --secure if true, uses SSL/TLS to communicate with the domain application server. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. Example 1: Using jms-ping asadmin> jms-ping --user admin --password adminadmin --host bluestar --port 4848 server1 JMS Ping Status=RUNNING EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jmsdest(1AS), asadmin-delete-jmsdest(1AS), asadmin-list-jmsdest(1AS) J2EE 1.4 SDK March 2004 asadmin-jms-ping(1AS)
All times are GMT -4. The time now is 06:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy