Tcl syntax: http://www.tcl-lang.org/man/tcl8.6/TclCmd/Tcl.htm
tcl commands :http://www.tcl-lang.org/man/tcl8.6/TclCmd/contents.htm
#!/bin/env expect --
# puts stdout "strings" one line
puts "Tcl version: $tcl_version" ;# inline comment
## print line number
proc linum {} {
if {[llength [info commands dict]]} {
return [dict get [info frame -1] line]
} elseif {![string equal -nocase precompiled [lindex [info frame -1] 1]]} {
return [lindex [info frame -1] 3]
}
return Unknown
}
puts "call proc @line:[linum]"
本文介绍Tcl编程语言的基础知识,包括Tcl语法概览、常用命令列表及示例代码。通过一个简单的脚本示例,展示了如何使用Tcl打印Tcl版本信息和调用过程并获取其所在行号。
3912

被折叠的 条评论
为什么被折叠?



