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

Re: [ns] TCL + commandline arguments



The arguments are found in $argv , and if you have more than one argument,
you can use lindex to get the different arguments. E.g. [lindex $argv 0]
is the first command line argument and so on.

So to print the first argument you would do something like

puts [lindex $argv 0]

/Anders

On Tue, 28 Aug 2001, sameer tilak wrote:

> 
> Hi All,
> I have a very simple doubt.
> Please tell me how to access the passed commandline
> arguments in TCL program ? 
> for eg. If I say ns tclfile.tcl 100
> I want to say print the passed commandline argument in
> this file how can I do that ?
> 
> Regards,
> -Sameer.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>