Hello,
I want to write a logout script, but when it executes, an error is reported:
logout: not login shell: use `exit'
Here is my script
I want to write a logout script, but when it executes, an error is reported:
logout: not login shell: use `exit'
Here is my script
Code:
#!/usr/bin/bash
do_logout() {
echo "y. Logout"
echo "n. Back to Previous Menu"
echo -n "Enter option [ y/n ]: "
read input
confirm=$(echo $input | tr '[A-Z]' '[a-z]')
if [ y == $confirm ]; then
logout
elif [ n == $confirm ]; then
menu
else
do_logout
fi
}