Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图理解以下代码中的 :t 但无法弄清楚,这些代码需要在 tcl 中转换。当我们打印它时,它会在斜杠上拆分单词 the 并返回最后一个元素。例如:用户 3、用户等
假设 d = /home/etc/user/user3
while 1 { set _f $_d:t }
您可能正在寻找file tail:
file tail
set _f [file tail $_d]
用 开始 Tcl 变量名通常不是一种好的风格_,但如果你愿意,这样做是很合法的。
_