glob

glob *.tcl

Find all the Tcl files in the user's home directory, irrespective of what the current directory is:

glob -directory ~ *.tcl

Find all subdirectories of the current directory:

glob -type d *

Find all files whose name contains an "a", a "b" or the sequence "cde":

glob -type f *{a,b,cde}*
 
set Path "/home/name"
set pattern "movie-*"
 foreach file [glob -directory [Path pics] $pattern.gif]  {
}
 
 
posted @ 2011-09-18 22:56  greencolor  阅读(219)  评论(0编辑  收藏  举报