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

Start a new shell from tclsh

2 views
Skip to first unread message

Svenn Are Bjerkem

unread,
Feb 15, 2007, 5:52:52 AM2/15/07
to
Hi,
I have been searching a bit for a solution without any luck so far.
I want to use tcl to set several environment variables and then with
those environment variables start a new tcsh.

If I do exec tcsh, then I get a dead line, if I type something and
press ctrl-d I get the feedback from tcsh, so it seems to work 50%. I
wonder how to get that exec'ed tcsh to become interactive like a
normal tcsh.

--
Svenn

Arjen Markus

unread,
Feb 15, 2007, 8:43:31 AM2/15/07
to

I see the same problem (Linux, Tcl 8.4.3). But is it really necessary
to start a
new tclsh? Couldn't you run a new interpreter instead? (Not sure
if that will work, though)

Regards,

Arjen

Uwe Klein

unread,
Feb 15, 2007, 8:57:30 AM2/15/07
to
does this work for you?:

exec tcsh <@stdin >@stdout 2>@stderr

uwe

Svenn Are Bjerkem

unread,
Feb 15, 2007, 10:19:37 AM2/15/07
to

Uwe Klein wrote:
> does this work for you?:
>
> exec tcsh <@stdin >@stdout 2>@stderr

Yes indeed it does. I used a workaround by exec xterm since that would
spawn a new tcsh, but that was not quite what I wanted. Your solution
is better. Thanks.

The reason why I want to do this is to change some environment
variables like $HOME before I let the user start programs. That way I
can make sure that startup files and log files are read and written to
the correct directory which is not always the users own home
directory.

--
Svenn

Ralf Fassel

unread,
Feb 16, 2007, 4:38:05 AM2/16/07
to
* "Svenn Are Bjerkem" <sven...@bjerkem.de>

| The reason why I want to do this is to change some environment
| variables like $HOME before I let the user start programs. That way
| I can make sure that startup files and log files are read and
| written to the correct directory which is not always the users own
| home directory.

Just being curious: why don't you (re-)set the environment before
starting the *first* tcsh?

env HOME=/somewhere FOOBAR=baz tcsh

?

R'

Donal K. Fellows

unread,
Feb 16, 2007, 9:29:37 AM2/16/07
to
Ralf Fassel wrote:
> Just being curious: why don't you (re-)set the environment before
> starting the *first* tcsh?
> env HOME=/somewhere FOOBAR=baz tcsh

Sometimes it can be hard to compute the correct values of the
environment variables to start out with. Never worry about doing an
extra [exec]; after all, shells do it all day long!

Donal.

0 new messages