Connected to a remote server via SSH.
On occasion, I run a specific bash script. When certain conditions are met (it's work completed successfully), I wish to be automatically logged out of the SSH tunnel.
In the normal login shell, I simply type
logout to logout.
I am unable to do this from a bash script. If I put
logout in a bash script, the error is:
logout: not login shell: use `exit'
Query: How do you automatically log yourself out of an SSH connection from a bash script?