I am using SCO Unix. I write a script to execute a program by calling
exec program
The script will check the program is still there or not, if not, then it will exit the script by calling
exit
So if I press DEL to quit the program, the script will exit, but it will logout also..... Is exit terminate the running script, but not the calling shell, right?
The command exit does just that, exit the current process. If the current process is the login shell, then you get logged off. What you are doing by calling exec program is to say 'replace the current shell with program' so when the program ends, there is nothing to go back to.
What is your desired response?
CNTL-d ends program but does not log out (where do you go then)
Failure to find program logs out
Normal termination logs out
The complete opposite of any/all of these?
If you can be clear about what you want to happen, then we can probably work out a way to make it so.