Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-12-2009, 01:17 PM   #1
LQ Newbie
Registered: Jan 2009
Posts: 5

Rep: Reputation: 0
bash - how to terminate a process after certain time


I want to run a program and after for example 3 minutes, if the program is still running, then terminate the process.

How could I write a shell script to achieve this? Thank you very much
Old 03-12-2009, 03:35 PM   #2
Senior Member
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
you could use the at command.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Bash] Waiting for a process to terminate or stopping it after some time hamtavs Linux - General 2 12-12-2008 06:25 PM
how ctrl+c works to terminate a process rithik_ghoshal Linux - General 2 11-02-2008 09:01 AM
how to terminate dispatch.fcgi process properly sathiyamoorthy Debian 0 02-27-2008 12:20 AM
ctrl-c to terminate a process does not work geek1234 Linux - Newbie 1 12-26-2007 03:34 PM
time a process within bash script aubrey-calm2 Linux - General 2 06-15-2007 02:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration