[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command line argument for ns?



See the thread ending:
http://www-mash.CS.Berkeley.EDU/dist/archive/ns-users/9810/0063.html

I'd point you to the actual recursive handle-parameters-and-switches
example code I posted earlier in that thread, but I stupidly posted
that email on the last day of a month; as a result, it's not visible
in the index for 9809.

The ns-users list archives are lossy.

L.


On Thu, 17 Feb 2000, Ibtissam El Khayat wrote:

> Tan Su Wei wrote:
> 
> > Dear all,
> >     I'd a question here,
> > can we passed command line argument to ns like in c / tcl.
> > for example :
> > ns sim_script.tcl arg1 arg2 ... ...
> >
> > Thank you .
> > Regards
> > Tan Su Wei
> 
> yes it's possible with tcl
> argv is a list wich reprepresent the arguments, (you should use lindex )
> 
> and argc the number of arguments
> for example
> ns ___.tcl 1000 FQ
> and code contains something like
> if { $argc != 2} {
>     puts stderr {usage: ns ___.tcl pktsize queue}
>     exit 1
> }
> Agent/TCP set packetSize_ [lindex $argv 0]
> $ns duplex-link $node3 $node4 1.5Mb 10ms [lindex $argv 1]
> 
> Good luck
> Ibtissam

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>