The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM



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

Join Date: Feb 2004
Location: NM
Posts: 3,865
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.
Reply With Quote