列表 1. 读取环境变量的 Tcl 脚本

#!/usr/bin/tclsh
puts "Content-type: text/html \n\n"
puts "<title>Environment Variables, \
   ala Tcl</title>"
set mylist [array names env]
foreach foo $mylist {
   puts "Variable Name: env($foo) \
      Value: $env($foo) <br>"
}
© . All rights reserved.