开发者_运维百科I have a line in my tcl code like this:
Application/BitTorrent set seqNo_ $opt(seqNo)
..I have an OTcl class name "Application/BitTorrent", I get this ERROR...
invalid command name "Application/BitTorrent" while executing "Application/BitTorrent set seqNo_ $opt(seqNo)"
can anybody tell me where the error might be?
thanks!
I hate to be the one to point out the obvious, but the error is exactly what the message says: at the time the error is thrown there is no command named "Application/BitTorrent".
This likely means one of three things: either the command name is misspelled, the command hasn't been created or has already been destroyed, or it exists but isn't visible in the current context (for example, it exists in some other namespace or package or file that hasn't been imported).
Besides the possibilities Bryan Oakey has pointed out, maybe you were running a wrong copy of ns
executable against your script. For example, you might be actually using /usr/bin/ns
instead of the one with your application code compiled within (typically /ns-all-in-one/bin/ns
). To check if this is the case under bash, use
type ns
If that is indeed the case, while the one is ahead in $PATH
, then it means the command hash in bash is outdated. You can use hash -d ns
to delete the old cache.
精彩评论