1752785 Members
6293 Online
108789 Solutions
New Discussion юеВ

Re: ksh equivalent

 
SOLVED
Go to solution
Joe Fern
Occasional Advisor

ksh equivalent

G'day all,

Is there an equivalent of "logout" in ksh?

I'm trying to log users off during the profile loading from a if statement if possible.

Cheers,

Joe
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: ksh equivalent

logout should work. Or you could just use 'exit'.
Joe Fern
Occasional Advisor

Re: ksh equivalent

Must say also posix shell.. if possible.

Cheers all.
Patrick Wallek
Honored Contributor

Re: ksh equivalent

Have you tried checking the man pages?

# man ksh

# man sh-posix
Daavid Turnbull
Frequent Advisor

Re: ksh equivalent

logout and exit work for all the shells I am familiar with??

if [ -z $HOME ]
then
logout
fi


should work fine in ksh
Behold the turtle for he makes not progress unless he pokes his head out.
Dennis Handly
Acclaimed Contributor
Solution

Re: ksh equivalent

>Daavid: logout and exit work for all the shells I am familiar with

There is no logout command in a real shell. Even the scummy C shell says not to use it since it "may not be supported in future releases".

As Patrick says, you must use "exit".
Joe Fern
Occasional Advisor

Re: ksh equivalent

Hey guys,

Thanks for the responses, didn't see ya post Patrick when I post my last msg.. cheers tho, exit is the only choice as I worked out logout will not work for us.

Thanks all :)

Rgds,
Joe
Dennis Handly
Acclaimed Contributor

Re: ksh equivalent

You haven't assigned any points. Please see:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Joe Fern
Occasional Advisor

Re: ksh equivalent

There you go..

Cheers Gents! :)