当运行我的tcl脚本的一部分时,我想警告某些打开终端的用户正在发生的事情。同时让他们知道消息是从哪个终端发送的。到目前为止,我有:
set who [exec who]
set user [lindex $who 0]
set who [split $who "\n"]
for { set i 0 } { $i < [llength $who] } { incr i } {
set current [lindex $who $i]
exec write $user [lindex $current 1]
# I would now like to