can't read "ns_o3": no such variable while executing
"set ns[new Simulator]"
(file "example.tcl" line 2)
注:没有在ns[new Simulator] 中间加空格分隔符
[root@localhost ~]# ns example.tcl
(_o3 cmd line 1)
invoked from within
"_o3 cmd duplex -link _o10 _o16 2Mb 10ms DropTail"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"$ns duplex -link $n0 $n2 2Mb 10ms DropTail"
(file "example.tcl" line 26)
注:duplex –link中间没有分割符。是一个整体
[root@localhost ~]# ns example.tcl
can't read "class_2": no such variable
while executing
"subst $[subst $var]"
(procedure "_o82" line 5)
(Object next line 5)
invoked from within
"_o82 next class_2"
("eval" body line 1)
invoked from within
"eval $self next $args"
(procedure "_o82" line 18)
(Agent set line 18)
invoked from within
"$tcp set class_2"
(file "example.tcl" line 38)
注:class_2中class_ 是变量 2是参数,中间要有分隔符。
总结:这次错误的主要点是对分割符的有无有点不理解,以后要多调试在能在实践中锻炼。技巧:在linux系统中,也存在快速的调用上次的命令,用键盘的上箭头即可。
https://blog.sciencenet.cn/blog-428172-309844.html
上一篇:
网络仿真利器NS-2无师自通七天速成系列Ⅶ:协议添加下一篇:
附录4:诺基亚研究中心招聘实习生