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

"Resetting" readonly variables in ksh / TMOUT question

1,713 views
Skip to first unread message

bernd wegener

unread,
Nov 25, 2003, 7:43:12 AM11/25/03
to
Hello folks,

is there a way to unset variables in the ksh which have been set
readonly ? In my case this concerns especially TMOUT, which is set
readonly in /etc/profile, so that the ksh is terminated after a
certain idle time. Can one workaround this in any way ?

Moreover: would a subshell to the above mentioned login shell be
terminated if it is not a login-ksh (e.g. a csh ?)

Is there a way to "keep-alive" a terminal in which a login-ksh with
the TMOUT-variable set without having to pass commands on the command
line ?

Is it really like said in the man-page that one has to issue commands
or is it sufficient to have input on the terminal to prevent the
shell from terminating ?

Thanks for any help in advance.


Cheers


Bernd Wegener

Stephane CHAZELAS

unread,
Nov 25, 2003, 8:04:43 AM11/25/03
to
2003-11-25, 04:43(-08), bernd wegener:

> is there a way to unset variables in the ksh which have been set
> readonly ? In my case this concerns especially TMOUT, which is set
> readonly in /etc/profile, so that the ksh is terminated after a
> certain idle time. Can one workaround this in any way ?

Start a new shell with that variable unset:

exec env -u TMOUT ksh

It shouldn't read the profile file again. Pay also attention to
the ENV var you may also want to unset.

--
Stéphane ["Stephane.Chazelas" at "free.fr"]

Stephane CHAZELAS

unread,
Nov 25, 2003, 8:31:53 AM11/25/03
to
2003-11-25, 14:04(+01), Stephane CHAZELAS:
[...]

> exec env -u TMOUT ksh
[...]

Note that "-u" is not a standard env option; if your env doesn't
have it, you can either use:

exec env TMOUT= ksh

which empties TMOUT, does not unset it but should have the same
effect or:

exec sh -c 'unset TMOUT; exec ksh'

0 new messages