DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

for_file(TCL)


for_file -- implement loop over contents of a file

Syntax

for_file var filename { code }

Description

This procedure implements a loop over the contents of a file. For each line in filename, it sets var to the line and executes code.

The break and continue commands work as with foreach.

Examples

The command
for_file line /etc/passwd {echo $line}
would echo all the lines in the password file.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003