This bash script in osx does not exit the script. I have changed the settings (as suggested here so that writing exit in terminal closes the window, and I've checked that writing exit does close the terminal window if I write it in the terminal, What could be the reason for this? I restarted terminal and my mac after changing the settings to see if that solved the problem. But exit in at location(s) nr 1 or at the end of the script does not work.
#!/bin/bash
PATH=/opt/local/bin:/opt/local/sbin:$PATH
read -p "What do you want to do?"
if test "$pass" = "f"
then
sh ~/f.sh
exit # nr 1
fi
if test "$pass" = "s"
then
sh ~/s.sh
exit # nr 1
fi
exit # nr 2