[comp.unix.questions] csh quick logout?

frank@zen.UUCP (Frank Wales) (01/29/88)

In article <20602@teknowledge-vaxc.ARPA> mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) writes:
>The discussions started by the "ignoreeof" posting brings this question
>to my mind:
>
>Is there a clean way -- other than using "jobs", then "kill", then
>{^D,exit,logout} -- to force a quick logout that will kill off your
>stopped jobs?

I just used   exec /   to quit from both ksh and csh.

It's simple, it seems to bump off any huppable stopped or running jobs
nicely, and it's very quick.  The only potential inconvenience is the 
"cannot execute" / "Permission denied" message as the shell prepares to
run a directory and dies trying; maybe you can live with that.


Frank Wales, Development Engineer,    [frank@zen.uucp<->mcvax!zen.co.uk!frank]
Zengrange Ltd., Greenfield Rd., Leeds, ENGLAND, LS9 8DB. (+44) 532 489048 x220 

greywolf@unicom.UUCP (if ($?NAME == 0) setenv NAME "`/u/select/greywolf/+bin/rndline /u/select/greywolf/+text/rndnames`") (01/30/88)

In article <20602@teknowledge-vaxc.ARPA> mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) writes:
>Is there a clean way -- other than using "jobs", then "kill", then
>{^D,exit,logout} -- to force a quick logout that will kill off your
>stopped jobs?

>For example, can you be sure that "kill -HUP 0" will make your stopped
>jobs terminate as well?  We've had people disconnect from the system
>(my guess is via "kill -KILL $$") and litter the system with stopped
>gnu-emacses and stopped-informix-sqls and whatnot.

Has anyone out there ever tried kill -1 -1; followed by kill -9 -1?
If used as a csh builtin, kill -$WHATEVER -1 will send a $WHATEVER signal to
every process on the system that is running as you *except* the shell it
was called from.  If used as /bin/kill, it will kill ALL processes on the
system belonging to you.  As you might guess, it is not wise to do a
/bin/kill -1 -1 if you are root... :-)

This is on 4.x BSD; but from what I saw of system V, it should work there
too.  I have found it extremely handy, especially with runaway processes that
know no bounds...


Roan (looks strange, sounds like "Rowan" as in Rowan & Martin) Anderson

-- 
 " <- (2 dots)		    ::   / | \ ...!{sun,ucbvax}!pixar!unicom!greywolf
Roan Anderson, Local Guru   ::  :  |  :
(which doesn't say much)    ::  : /|\ : war: Invalid argument.
:::::::::::::::::::::::::::::::: =_|_=  ::::::::::::::::::::::::::::::::::::::

neil@ist.CO.UK (Neil Todd) (02/01/88)

In article <1145@zen.UUCP>, frank@zen.UUCP (Frank Wales) writes:
.
> >Is there a clean way -- other than using "jobs", then "kill", then
> >{^D,exit,logout} -- to force a quick logout that will kill off your
> >stopped jobs?
> 
> I just used   exec /   to quit from both ksh and csh.
> 
> It's simple, it seems to bump off any huppable stopped or running jobs
> nicely, and it's very quick.  The only potential inconvenience is the 
> "cannot execute" / "Permission denied" message as the shell prepares to
> run a directory and dies trying; maybe you can live with that.
> 
.
.
.
> 
> Frank Wales, Development Engineer,

I prefer to use ``exec true'', this gives no nasty message, and is
inheriently more sanitary. 

Neil

Imperial Software Technology, London.