Computing.Net > Forums > Unix > Executing script on exit

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Executing script on exit

Reply to Message Icon

Name: hismail
Date: April 17, 2007 at 23:16:03 Pacific
OS: DG/UX
CPU/Ram: 4gig/3gig
Product: DG
Comment:

Hi
I would like to execute a script on exit
for example:
#!/bin/sh

./script

when I type exit the "./script: must excute on the screen

Thanks
Hamim



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: April 18, 2007 at 20:26:12 Pacific
Reply:

Place this command in your .profile. It should work in both sh & ksh:

trap '. /path/to/logout.sh; exit' 0


0

Response Number 2
Name: hismail
Date: April 19, 2007 at 00:21:40 Pacific
Reply:

Hi Nail
Thanks for your help ,it works like are charm

Hamim


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Executing script on exit

force the script to exit w/0 www.computing.net/answers/unix/force-the-script-to-exit-w0-/4303.html

how to execute a expect script www.computing.net/answers/unix/how-to-execute-a-expect-script/5382.html

Exiting 2 scripts at once. www.computing.net/answers/unix/exiting-2-scripts-at-once/6831.html