You don't said enough about what you do with tcl but I'll try to guess again.
Correct me if this is not true:
1/- you enter a terminal session
- you have a generated csh script that let you cd to the right directory where to launch gladiator
- after that you enter the command:
Code:
source /user/home/abc.csh
you can enter the command:
and all works fine
2/- you enter a tclsh session
- you have a generated csh script that let you cd to the right directory where to launch gladiator
- after that you enter the command:
Code:
exec csh /user/home/abc.csh
you can enter the command:
but you get the message
If this is correct, I can say you why.
I don't know csh but can guess that the
command of csh is roughly the equivalent of
(dot) command in sh. That's the called script is evaled in the context of the caller script (more below).
1/ The
command of csh and the
command of Tcl do similar things but not the same.
2/ source in csh modify the file environment at the session level (roughly: does a cd for you).
exec in Tcl launches a csh session that is different of your tclsh session and when the csh returns, UNIX restores the cd of tclsh (it's not what you wanted). And it's why you get the message (the cd that you need is vanished).
An explanation about programs environment:
In UNIX all programs have an environment where are defined variables as PATH.
When a program calls a program (when tclsh launches csh) the environment of the caller is copied in the environment of the called. So all modifications of the environment of the called do NOT modify the environment of the caller.
Only shell scripts can do a magic: with the dot command or the source command they can modify their environment from the script called (because it's them that interpret the called script). And tclsh can do the same magic with it's source command.
What you can do?
1/ Use only csh and cd thru the source command of csh.
2/ Use only tclsh and cd thru the source command of tclsh.
For the later, the generated script must be a Tcl script:
(.../gladiator has to be replaced by the right directory where gladiator lies).
HTH
ulis