iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)
Tool Command Language (Tcl) Basics
iTP Secure WebServer System Administrator’s Guide—523346-002
E-5
Script Commands
pwd
The pwd command returns the current working directory, which is the directory
containing the configuration script. The information returned by the pwd command
is especially useful for composing pathnames that are relative to the location of the
configuration script.
expr expression
The expr command interprets expression as either a numeric expression or
a string comparison and returns the result. For example:
Table E-1 lists the operators allowed in Tcl expressions; they are grouped in
decreasing order of precedence.
Command Return Value
expr 4+5 9
expr 10*4 40
expr "foo" == "foo" 1
expr "foo" ! = "foo" 0
Table E-1. Tcl Expression Operators (page 1 of 2)
Operator Description
-
~
!
Unary minus, bit-wise NOT, logical NOT. None of these operators may be
applied to string operands. Bit-wise NOT may only be applied to integers.
*
/
%
Multiply, divide, remainder. None of these operators may be applied to string
operands; remainder may only be applied to integers. The remainder always
has the same sign as the divisor and an absolute value smaller than the
divisor.
+
-
Add and subtract. Valid for all numeric operands.
<<
>>
Left and right shift. Valid only for integer operands.
<
>
<=
>=
Boolean less, greater, less than or equal, greater than or equal. Each operator
produces 1 if the condition is true; 0 if false. When applied to strings, these
operators perform comparison.
==
!=
Boolean equal, not equal. Each operator produces a 0 or 1 result. Valid for all
operand types.
& Bit-wise AND. Valid only for integer operands.
^ Bit-wise exclusive OR. Valid only for integer operands.
| Bit-wise OR. Valid only for integer operands.