Problem is that i have a bash script that requires user to login and perform operations. Everything is logged in a log file. Now issue is if user exits the terminal, the scripts keeps running and keeps logging as enter key as an input even though no one is using the script. I want help such that if terminal is closed, the script itself kills its PID. or If multiple times enter key is given as input, the script kills its PID.
Any help in this regard will be appreciated.
I am using bash scripting and using AIX.