Shell script termination notification -


i have requirement in shell script in case if shell terminates reason i.e terminal closed or user terminated, work clean , unlocking etc. possible? if please explain how can done. in advance, praveen p b

yes possible. check signal using trap command. see help trap.

example

cleanup() {     ...     exit }  trap cleanup sigint # user terminated trap cleanup sighup # terminal closed trap cleanup sigterm # killed kill -15 

Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -