Sorry if this is a FAQ ...
I am trying to create a ksh script, invoked by .profile, to be
used as a simple menu for novices.
One of the case choices that should be available is "logout",
not just exit the menu script.
How?
I am trying to create a ksh script, invoked by .profile, to be
used as a simple menu for novices.
One of the case choices that should be available is "logout",
not just exit the menu script.
How?
Hmm..my first idea would be to kil the parent process, assuming that the
menu is invoked at login, just kill the login process, as well as the
menu process. As ksh is based on sh, I'm pretty sure there is a way in
shto recognise the PPID of the current process, as well as the current
PID, then all you do is kill off PID and PPID - however this is a bit
brusque, and there might be a nicer way.
As for how to identify the PID's - I can't remember offhand, but the
book by Kernighan and Pike mentions it from memory.
rgds..
--
Gunther Feuereisen Australian Graduate School of Management
'kill -9 0' should do it for youQuote:>Sorry if this is a FAQ ...
>I am trying to create a ksh script, invoked by .profile, to be
>used as a simple menu for novices.
>One of the case choices that should be available is "logout",
>not just exit the menu script.
>How?
--
kevin j brandich, systems analyst |
Well, if the .profile starts the ksh script, it will execute it just like it
would under normal circumstances - the program gets run, and then the .profile
continues. So, just put "logout" right after the program name. When the
program exits, the .profile will continue, see "logout", and logout the user.
Of course, this brings up the question of letting other people use your
account, but that's between you and your sysadmin...
--
Joshua A. Laff, CRL Head Operator, University of Illinois (217) 333-7408
___________________________________________________________________________
Disclaimer: If I were speaking for the UofI, I wouldn't be paying tuition.
Create your menu, put it in a script, call it for example menu.Quote:>Sorry if this is a FAQ ...
>I am trying to create a ksh script, invoked by .profile, to be
>used as a simple menu for novices.
>One of the case choices that should be available is "logout",
>not just exit the menu script.
>How?
Then, last line of your .profile says:
exec menu
Your menu has an exit function, when you select the exit option, you
will be logged off.
If you don't understand or you want more information, send me some
email.
--
__^__ __^__
( ___ )------------------------------------------------------------( ___ )
|___| Aritfical intellegence is no match for natural stupidity! |___|
1. Process id of parent shell from shell script
Hi,
$$ gives process id of current shell. How to get process id of parent
shell.
Thanks
Sujit
2. create_thread : out of memory
3. How to terminate a login session from a shell script?
4. how to burn files onto CD *as MP3* in kreatecd or koncd
5. How to terminate a login process in a shell script?
7. How to terminate a login session from a shell script?
8. GDB,GCC PostScript Documentation
9. Terminating Parent/Child User Written Korn Shell Functions???
10. shell script as login shell
11. using born shell script as login shell?
12. How to run shell script without login shell?