DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
(TCL) commands by type

File scanning commands

These commands provide a facility to scan files, matching lines of the file against regular expressions and executing Tcl code on a match. With this facility, you can use Tcl to do the sort of file processing that is traditionally done with awk(C).

Since Tcl's approach is more declarative, some of the scripts that can be difficult to write in awk are simple to code in Tcl.

File scanning in Tcl centers around the concept of a scan context. A scan context contains one or more match statements, with associated regular expressions to scan for, and Tcl code to be executed when the expressions are matched.

Available commands are:


scancontext(TCL)
sets the scan file context

scanfile(TCL)
scans an open file starting from the current position

scanmatch(TCL)
specifies Tcl commands to be evaluated when regexp(TCL) is matched by a scanfile

Next topic: Math commands
Previous topic: TCP/IP server access

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003