iTP Secure WebServer System Administrator's Guide (iTPWebSvr 5.1+)
Tool Command Language (Tcl) Basics
iTP Secure WebServer System Administrator’s Guide—522659-001
E-2
Tcl Syntax Rules
•
If an argument itself contains spaces or tabs, it must be delimited with either double
quotation marks (") or curly braces ({}). If you delimit an argument with curly
braces, no command or variable substitution (described below) will occur within the
argument.
For example:
Message error-forbidden {
<TITLE>Access Denied</TITLE><H1>Access Denied</H1>
You have been denied access.
}
•
Arguments delimited with curly braces can be nested. These arguments can consist
of commands.
For example:
Region / {
if [HostMatch *.widget.com] {
Redirect /widget-welcome.html
}
}
•
Multiple commands are separated by semicolons or by end-of-lines.
For example:
puts stdout "Hello world!" ; exit
•
The backslash ( \ ) character indicates that the next character is to be interpreted
literally. This feature is useful for including special characters (such as $, [, and ]) in
command arguments. A backslash at the end of a line indicates that the command is
continued on the next line.
For example:
DenyHost *.openmarket.com *.foo.com *.bar.com *.widgets.com \
*.unerd.org
•
A dollar sign prefixed to a variable name indicates variable substitution: the value of
the named variable is substituted for its name.
For example, in the following example, the path resolves to
/httpd/logs/httpd.log:
set root /httpd
ExtendedLog $root/logs/httpd.log
•
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]