Name

for_recursive_glob

for_recursive_glob var dirlist globlist code

Perform a foreach -style loop over files that match patterns. All directories in the list dirlist are recursively searched for files that match the glob patterns in list globlist. For each matching file the variable var is set to the file path and code code is evaluated.

Example

for_recursive_glob file {˜ /tmp} {*.tcl *.c *.h} {
        echo $file
    }

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.