I need to run a script to get a value from output, set a varible then use it inside of scrip. the script is this:
tn = telnetlib.Telnet(line)
tn.read_until("Username: ")
tn.write(user + "\n")
tn.read_until("Password: ")
tn.write(password + "\n")
tn.write("enable \n")
tn.write(password + "\n")
## GET VOIP INTERFACE
tn.write("sh int desc | i VOIP \n")
the output will genarate something like this:
router01011#sh int desc | i VOIP Gi0/1.110 up up Local - VOIP
Then I need to get the first 10 characters (in this case would be Gi0/1.110) of the last line and put it in a variable string. How could I do that?
Thank you!
With python, you could save the values in a variable and then
I hope this help you