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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -