Re: running tcl shell interactive with source
- From: rfoxmich <rfoxkendo@xxxxxxxxx>
- Date: Thu, 9 Apr 2009 04:43:49 -0700 (PDT)
Is this on a windows box? If so try the following
1. Make a bat file for each of the scripts you'd like preloaded
when the user starts tclsh. The bat looks like:
cp myscriptfile.tcl "%HOMEPATH%\tclshrc.tcl"
tclsh
2. Make desktop shortcuts to the batch files.
This uses the fact that tclsh will source %HOMEPATH%\tclshrc.tcl
prior to providing the command prompt. On unix you can do a similar
thing but
but the script will copy myscriptfile.tcl to ~/.tclshrc
RF
On Apr 9, 7:28 am, esd.protec...@xxxxxxxxxxxxxx wrote:
Hi,
I would like to run a tcl shell interactively, but also want to
provide a file to 'source' on the command line.
The reason for asking is that I've a number of scripts that are used
interactively, that have various procedures in them. The procedures
are run by the user to test hardware. But I don't want the user to
type in 'source' followed by the name of a script in a shell - what I
want is a shortcut on the desktop that they click to bring up the
shell with the appropriate file already 'sourced'.
It doesn't look as if I can do this with tclsh, so I've tried tkcon
with command line:
-main "source my_tcl_file.tcl"
Which looked promising..... but unfortunately, although
my_tcl_file.tcl is indeed sourced in the shell (I know this because I
have a puts in the file), none of the procs and variables set in that
file are available by the time I get to use the prompt!!
Is there a way that I can acheive this? Or are there any other tcl
shells I can investigate?
Thx
.
- Follow-Ups:
- Re: running tcl shell interactive with source
- From: esd . protected
- Re: running tcl shell interactive with source
- References:
- running tcl shell interactive with source
- From: esd . protected
- running tcl shell interactive with source
- Prev by Date: running tcl shell interactive with source
- Next by Date: Re: Tkhtml3 - parsing an html file
- Previous by thread: running tcl shell interactive with source
- Next by thread: Re: running tcl shell interactive with source
- Index(es):
Relevant Pages
|