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

Re: [ns] Passing Arguments



Apu Kapadia wrote:

> Hello,
>
> How can I pass arguments to my .tcl scripts, so that I can set up multiple
> simulations of the form:
>
> ns simulation.tcl arg1 arg2
>
> How can I access arg1 and arg2 from within simulation.tcl
>
> Thanks,
> Apu

argv is the list of command line arguments. You can use something like this in
your script:

if {[llength $argv] != 2} {
        puts "Missing parameters... link_bw tcp_window"
        exit 1
}

set bw [lindex $argv 0]
set win [lindex $argv 1]



-- Felix Hernandez