01-10-2013 05:19 AM
Hello together,
how can I get the username of the user who is configuring on the ios shell and saved the running-config to memory with TCL?
The username should be saved into a variable and will be put out as part of a filename.
Do you have an idea how to script that?
BR Patrick
01-10-2013 06:53 AM
I found a variable which is filled with the active user logged on to the router....
set username $tcl_platform(user)
set location sup-bootflash:$username.conf
when i check the variable on the tclsh I get the output of my current user who is logged on
If I check the output of $username it is blank and not filled.
any idea`?
01-14-2013 06:46 AM
This is working for me. I can't explain why a variable would be empty after you set it:
NE100(tcl)#puts $tcl_platform(user)
user1
NE100(tcl)#set username $tcl_platform(user)
user1
NE100(tcl)#puts $username
user1
NE100(tcl)#set username $tcl_platform(user)
user1
NE100(tcl)#
NE100(tcl)#set location sup-bootflash:$username.conf
sup-bootflash:user1.conf
NE100(tcl)#
NE100(tcl)#
NE100(tcl)#
As a workaround, you can access $tcl_platform(user) directly. Does this work for you?
set location sup-bootflash:$tcl_platform(user).conf
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