04-17-2013 10:27 AM
I'm reading through the book & it's unclear to me how to do an argument for running a script. What I'm trying to do is something like this:
tclsh flash:/test.tcl username password ip_address
Where username & password would be an scp username & password & ip_address would be scp ip address. I'm thinking this is related to the argv arg0, but I don't see a specific example.
Thanks,
Cory Anderson
Solved! Go to Solution.
04-17-2013 10:31 AM
Yup:
set username [lindex $argv 0]
set password [lindex $argv 1]
set my_script_name $argv0
04-17-2013 10:31 AM
Yup:
set username [lindex $argv 0]
set password [lindex $argv 1]
set my_script_name $argv0
04-17-2013 10:36 AM
Thanks Joseph,
I was hoping it was that easy. Is there a limit to the amount of arguments that I can have for initialization?
04-17-2013 11:35 AM
Not reall, but practically, you're limited by I believe 256 characters of the IOS CLI.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide