我有这样的代码:
...
proc myProc {first last} {
for { set i $first } { $i <= $last } { incr i } {
set i_cur "PlainText$i"
<command> [glob ./../myDir/${i_cur}*]
}
}
当我运行它时,任何在数字之后没有任何内容的文件都可以正常运行。但如果数字后面有什么东西,那就没有了。例如,我有名为PlainText0.txt
、PlainText00.txt
和的有效文件PlainText1_Plaintext.txt
。前两个工作,PlainText1_Plaintext.txt
没有。
基本上,我认为我没有正确使用全局/通配符,但不知道如何。