我如何发送这个值
24.215729
24.815729
25.055134
27.123499
27.159186
28.843474
28.877798
28.877798
到 tcl 输入参数? 如您所知,我们不能使用管道命令,因为 tcl dosent 以这种方式接受! 我能做些什么来将这个数字存储在 tcl 文件中(这个数字在变量中的计数,可以是 0 到 N,在这个例子中是 7)
最佳答案
这在 bash 中很容易做到,将值列表转储到一个文件中,然后运行:
tclsh myscript.tcl $(< datafilename)
然后可以使用参数变量在脚本中访问这些值:
puts $argc; # This is a count of all values
puts $argv; # This is a list containing all the arguments
关于linux - 使用 ns2 的 TCL 中的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13112831/