Hello to the ruby world I was hoping to get a bit of guidance… I
have the following code below that logs int to a cisco router and
performs a command:
You may find Net::SSH::Telnet easier to use than Net::SSH with exec,
especially when it comes to exchanging multiple commands and responses.
Also you can use the same code with both Net::Telnet and
I would like to scan this output and assign only the IP address between
the ##'s to a variable for further use.
Look at the methods of class String, expecially String#scan
=> “AMP_STL_Intra_SW4#sho ip route 184.108.40.206\nRouting entry for
220.127.116.11/25\n Known via “connected”, distance 0, metric 0
(connected, via interface)\n Routing Descriptor Blocks:\n * directly
connected, via Vlan307\n Route metric is 0, traffic share count is
str.scan(/Routing entry for ([0-9.]+)/)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.