Name

for_file

for_file var filename code

Loop over the file filename, setting var to the line and executing code for each line in the file.

Example

for_file line /etc/passwd {
        echo $line
    }

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.