[lug] C shell wrapper for tcl/tk GUI question

arnie asherman1 at uswest.net
Thu Dec 23 20:30:55 MST 1999


I have written a little GUI in tcl/tk to automate some ftp transfers I
need to do on a regular basis. When I start it in a local shell it
works
fine, but when I telnet to the server I need to send the files from
and
try to start it I get a message that the TCL_LIBRARY environment
variable is not set, which is true, as an echo $TCL_LIBRARY proves. I
can set this environment variable at the command line and then start
the
tk GUI with no problem on the remote server.

I then tried to write a C shell script to act as a wrapper. It has the
following:

#!/bin/csh
# set the environment
setenv TCL_LIBRARY /path/to/the/library
setenv TK_LIBRARY /path/to the/library
# start the GUI
ftp_send

Now when I run this script nothing happens. When I try to echo these
values they are not set.
If I issue this on the command line the GUI starts and works fine.
Also,
if I put these 3 commands into an alias like this:

alias start_ftp_send 'setenv TCL_LIBRARY /path/to/the/library; setenv
TK_LIBRARY /path/to the/library; ftp_send'

then the alias will start the GUI w/ no trouble. Can anyone tell me
how
to get this C shell wrapper to work? I assume that I need to export
the
environment variables somehow, but I don't know the C shell equivalent
of Korne shell's export keyword.

By the way, I am actually using this on a Solaris network at work,
though I prototyped it on my Linux box at home.
thanks,

--
arnie sherman
frenomulax at bigfoot.com

"Paradise is exactly like where you are right now,
 only much, much better."
        -Laurie Anderson








More information about the LUG mailing list