Review your favorite Linux distribution.
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 04-09-2012, 12:49 AM   #1
LQ Newbie
Registered: Apr 2012
Posts: 9

Rep: Reputation: Disabled
Smile Automatica excecution of shell scripting on termination of a program

i just want to excecute a script automatically when a program terminates.How that could be done? and how to have popups through shell scripting?
Old 04-09-2012, 12:56 AM   #2
Registered: Oct 2009
Location: Leander, TX
Distribution: Fedora 20
Posts: 97

Rep: Reputation: 35
One way you could get a shell script to execute on the termination of a program, would be by calling that program through a script itself. If this is done the shell is idle while the program executes, then continues normal flow when the program ends. Using a shell as this kind of wrapper would allow you to write different flows based on the exit status of the program (see echo $?) -Edit: Kind of a hack I know, but it's the only way I could think to do something like this-

Pop ups on the other hand, I'm not sure how to do through bash(?)
Old 04-09-2012, 01:18 AM   #3
LQ Newbie
Registered: Apr 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you ...I want the script to be idle when the program runs and immediately get excecuted on the termination on the excecution of that program, without writing more than one script.


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
real-time signals cause program termination miles_christian Programming 2 08-21-2006 10:59 PM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
Question about abnormal program termination ghoughto Programming 5 06-15-2005 07:04 AM
shell script - trap program termination dnijaguar Linux - Software 0 07-19-2003 12:27 AM
Random program termination - odd jamespetts Linux - General 4 11-01-2002 04:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:05 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