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
Post a Comment