Pattern Globbing

Many Tcl commands, most notably glob, support filename globbing using the following forms:

?

Match any single character.

*

Match zero or more characters.

[abc]

Match characters in set abc.

[a-z]

Match range of characters a through z.

\c

Match character c.

{a, b,...}

Match any of strings a, b, etc.

˜

Home directory (for glob command).

˜user

Match home directory of user (for glob command).

Note

For the glob command, a period at the beginning of a file’s name or just after “/” must be matched explicitly and all “/” characters must be matched explicitly.

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.