iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)

Tool Command Language (Tcl) Basics
iTP Secure WebServer System Administrator’s Guide523346-002
E-3
Tcl Commands
Square brackets delimiting a command indicate command substitution: the
delimited command is to be executed immediately and its return value is
substituted for the bracketed command.
For example, in the following example, if [pwd] resolves to /httpd/logs, then path
is set to /httpd/logs:
set path [pwd]
Tcl Commands
This section describes Tcl commands in general and then discusses specific Tcl
commands commonly used in configuration scripts.
A Tcl command consists of a command procedure (keyword) followed by zero or more
arguments. For example:
puts stdout "Hello world!" ; exit
In this example, puts is a command procedure with two arguments: stdout and the
string Hello world! It writes Hello world! to standard output. The second
procedure, exit, has no arguments; it simply causes the Tcl script to terminate.
Tcl commands can take five different kinds of arguments:
Numeric
Numeric arguments consist of either integers or floating-point numbers. Tcl
command procedures expect number-valued arguments to be a single value (for
example, 13 or 1.34). Expressions can be used in arguments if they are evaluated
by the Tcl command procedure expr, which returns a single value. For example:
set my_num [expr 2*3]
Tcl provides the same arithmetic, logical, bit-wise, and relational operators, as well
as math functions, used in the C language. The one exception is that the relational
operators are also used on string values for comparison.
String
String arguments consist of sequences of ASCII characters, including spaces. For
example:
"Access Denied!"
Note the required use of quotes.
List
List arguments consist of zero or more elements separated by spaces. For
example:
"*.status.com *.money.com *.power.com"
Note the required use of quotes.