![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What happens when user logout? | yhacks | Linux | 1 | 05-16-2008 02:20 AM |
| Exit or logout | kinai | UNIX for Dummies Questions & Answers | 1 | 04-14-2008 08:44 AM |
| .logout | sharif | SUN Solaris | 3 | 12-24-2007 05:08 AM |
| .logout help | 2dumb | Shell Programming and Scripting | 3 | 05-10-2007 11:49 AM |
| logout | zam | UNIX for Dummies Questions & Answers | 2 | 12-28-2006 07:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to logout
Hi
I am using UNIX version. HP-UX HP-UNIX B.11.00 I am writing a script which on certain condition should logout of unix. But with exit command i am not able to get this.. Plz suggest how i should logout of the session directly. |
|
||||
|
You want the script to logout of UNIX?
In your script... Code:
kill -9 $PPID (it does kinda assume that the parent process is the login one) Basically you need to find the PID of the "-ksh", "-bash", or whatever process that's your login process - and kill it. If your want to make sure the script always logs out once it's done, add something like Code:
trap 'kill -9 $PPID' 0 1 2 9 15 16 Last edited by scottn; 06-20-2009 at 06:00 PM.. |
|
||||
|
And if it is buried under a layer of subshells ...
Code:
kill -9 `ps -o "%P"` |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|