Equivalent C shell .logout script in Borne Shell

Equivalent C shell .logout script in Borne Shell

Post by kon.. » Fri, 29 Oct 1999 04:00:00



In C shell, how .logout is executed after exiting the shell ?

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Equivalent C shell .logout script in Borne Shell

Post by Ken Pizzi » Fri, 29 Oct 1999 04:00:00



>In C shell, how .logout is executed after exiting the shell ?

In C shell .logout is executed by the shell as its final
processing before it exits, not after it exits.  It is done
by the code which detects that the user has requested the
login shell to exit.

Reading your subject line makes me think you're actually meaning
to ask a different question, however: how does one make the
Bourne shell process a ".sh_logout" (or whatever) file when the
user requests their login shell to exit?  The answer is to set a
"trap" on the pseudo-signal "0" in their .profile:
  trap '. $HOME/.sh_logout' 0

                --Ken Pizzini

 
 
 

1. using born shell script as login shell?

Is there any problem with using a #!/bin/sh script as a login shell (i.e., in
the passwd file) for a user account.  I'd like the user to be able to access
various applications from the shell script and be logged off after
terminating the script.

This is not an attempt at a security measure.  Escape to a unix prompt from
the script is not a problem, although it should'n happen accidentallly.

2. SetUID question

3. Borne Shell Script

4. Bug in <pthread.h> ?

5. Tricky Born shell script with a here document...

6. can't symlink

7. handling SIGINT in shell scripts when executing another shell script.

8. RH 7.1 and ASUS A7M266 onboard sound??

9. Q: How can I have a shell script call another shell script...

10. Shell script invoking other shell scripts

11. Convert Bash shell script to Korn shell script

12. Shell Script Help (C-Shell Script)

13. How to pass a variable from a shell script to another shell script...