Next | Prev | Up | Top | Contents | Index

Tcl--Tool Command Language

Tcl is an interpreted programming language much like the Bourne shell or the C shell. Unlike these shells, Tcl uses curly braces instead of single quotes to guard against variable, command, and backslash substitution. Also, Tcl uses square brackets instead of backquotes to perform command substitution. Tcl's expression and control flow syntax resembles the C shell more closely than the Bourne shell.

Delimiters: Tcl Versus Shell
TclShellWhat it Does
{ } ' 'prevents variable, command, or backslash substitution
[ ] ` `performs command substitution

Strings are the only data type in Tcl, although numeric calculation is possible with the expr function. The Tcl language contains a collection of list manipulation facilities including append, insert, search, replace, join, split, and sort procedures.

New procedures can be written in Tcl using the proc keyword, or bound to compiled C or C++ procedures for greater efficiency. In fact Tcl is implemented as a library of C procedures, as are most Tcl extensions.

You can run extended Tcl interactively using either the tclsh or sgitcl command; see the tclsh(1) or sgitcl(1) reference pages for details. There is no way to run unextended Tcl by itself using the SGITCL facility, and really no reason to do so.


Tcl Syntax and Semantics

Next | Prev | Up | Top | Contents | Index