I will offer some possible thoughts that pop into my mind when I read your question.
To get to our back-end I open up an xterm onto our AIX cloverleaf server to get to the command prompt.
If I want to simply test something out simple to understand a TCL command then I launch the interactive TCL interpreter via
hcitcl
If I want to write a stand-alone TCL script then I put these lines at the top of my TCL script and do a chmod 775 on the file
#!/usr/bin/ksh
# this line to escape the next line from the tcl interpreter
exec hcitcl “$0” “$@”
There are some other variations of the lines that you can put at the top of a standalone TCL script to get it to work and perhaps some other clovertechies will post some of those.
Once I have the script written I invoke it manually by typing the name of the script assuming it is in a directory in my path.
Another common way I invoke a stand alone TCL script is to schedule it via cron.
Here is a very simple example of one of our standalone TCL scripts ( file_mtime.tcl ) to better complete the picture of what I’m describing:
#!/usr/bin/ksh
# this line to escape the next line from the tcl interpreter
exec hcitcl “$0” “$@”
# Begin Module Header ==============================================================================
#
#——
# Name:
#——
#
# file_mtime.tcl
#
#———
# Purpose:
#———
#
# Display to sdtout the mtime (last modification time) of the specified file
# In the following format:
#
# CCYY.MM.DD__HH.MM.SS
#
#——–
# Inputs:
#——–
#
set name [lindex $argv 0]
if {[cequal $name “”]} then {exit}
#
#——-
# Notes:
#——-
#
# none
#
#———
# History:
#———
#
# 2001.02.16 Russ Ross
# – wrote initial version
#
# End of Module Header =============================================================================
set type [file type $name]
if [cequal “$type” “file”] {
set mtime [file mtime $name]
puts stdout [fmtclock $mtime “%Y.%m.%d__%H.%M.%S”]
}
If I do this at the AIX command prompt
cd /usr/local/scripts
file_mtime.tcl file_mtime.tcl
then I get this displayed
2005.08.03__16.45.48
Russ Ross
RussRoss318@gmail.com