I have a script that checks for the existence of a file and, if this file doesn't exist, I want the script to output a message to the screen then terminate.
This is all fairly simple and I've got a solution that works, only problem is, when the script terminates, it closes my PuTTY session!
Below is the code I'm using:
if [ ! -e _Settings.sh ] ; then
echo "Unable to find _Settings.sh!"
read prompt?'Please create _Settings.sh before continuing. Press any key to continue . . .'
Is there an alternative to 'exit' so my session can remain open? I know I could expand the if clause with an else but that just seems a bit overkill imo.
Thanks in advance!