DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
(1tcl) 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(1).

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(1tcl)
sets the scan file context

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

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

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004