Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Logout in the Shell script

1 view
Skip to first unread message

Welcome to dma378!

unread,
Jun 1, 1994, 2:59:59 AM6/1/94
to
Hello all UNIX funs:
Can anyone kindly tell me how to logout in the shell script?
What I get when trying to do so is "Not a Login Shell!!!"
However, I don't want to "exec [my script]", which logout me when exit this
script. Help Help Pls Help............
Thank you for your kind attention.

Stanley

jestin

unread,
Jun 3, 1994, 4:59:43 AM6/3/94
to
In article <1994Jun1.0...@uxmail.ust.hk>, sta...@myhost.subdomain.domain (Welcome to dma378!) writes:
> Hello all UNIX funs:
> Can anyone kindly tell me how to logout in the shell script?
[...]

Consider % kill -9 -1
there's a kindest way: examine all your pids with awk,
find out which is the father, and kill him.
But, the basic *pan* way is quite effective !

__________________________ `o O'
/\ jes...@eis.enac.dgac.fr\__________ooO__U__Ooo_________
\ \ Ader239, ENAC, 7 av E.Belin, 31055 TOULOUSE (FRANCE)\
\ \ you can find me at #62175852 ... if you're lucky \
\ \_______________________________________________________\
\/_______________________________________________________/

Tim Pushor

unread,
Jun 3, 1994, 4:40:28 PM6/3/94
to
Welcome to dma378! (sta...@myhost.subdomain.domain) wrote:
^^^^^^^^^^^^^^^^^^^^^^^ <- Original :-)
Tim
--
Tim Pushor, Administrator CANet Systems
pus...@canet.cuug.ab.ca Calgary, Alberta, CANADA

Chris Alfeld

unread,
Jun 5, 1994, 1:25:02 PM6/5/94
to
jestin (jes...@apollo10.eis.enac.dgac.fr) wrote:

: In article <1994Jun1.0...@uxmail.ust.hk>, sta...@myhost.subdomain.domain (Welcome to dma378!) writes:
: > Hello all UNIX funs:
: > Can anyone kindly tell me how to logout in the shell script?
: [...]

: Consider % kill -9 -1

I use:
kill -9 `ps -aux | grep $USER | grep sh | grep -v grep | awk '{print $2}'`
This kills all the current users shells, you could make it a little more
complex to only kill the login shell if you wanted to.

--
-Chris (cal...@math.utah.edu cal...@east.east-slc.edu)

Liam

unread,
Jun 5, 1994, 2:37:22 PM6/5/94
to
Chris Alfeld wrote:
>I use:
> kill -9 `ps -aux | grep $USER | grep sh | grep -v grep | awk '{print $2}'`
>This kills all the current users shells, you could make it a little more
>complex to only kill the login shell if you wanted to.

I'd do:

kill -9 `ps -aux | grep $USER | grep '\-*sh' | grep -v grep | awk '{print $2}'`

That will kill login shells for most shells, not just the Bourne shell (sh)
such as csh, tcsh, zsh, ksh etc.


Liam.


--
Liam Crilly
L.Cr...@herts.ac.uk
<a href=http://altair.herts.ac.uk:8000/><i>
Not enough imagination for a quote.</i></a>

0 new messages