The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > Linux
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-16-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,794
if you source a shell script that has the exit keyword in it, your process ends and you have to login again. No regular user command, like ls, awk, etc. will do that.


Code:
# sourcing a script note the leading dot
. myscript
# sourcing a script on linux - you can do this as well as the dot notation
source myscript
# this will not log you out
myscript

The only other command that can remove your process is

Code:
kill $$

and some oither variations of kill. Any script with the kill $$ command in it will end when the kill command is executed. Then you have to login again.