I am new to Expect and scripting in general. I am trying to make a few scripts to make my life a bit easier when pulling network device configurations. I managed to create a
Or use set ip [gets stdin] to the IP address from the user input.
set ip [gets stdin]
For example,
puts "Enter your IP address\n" set ip [get stdin]
Use this in spawn. We can do the same for multiple IP addresses using a loop -
spawn
spawn ssh $ip -l admin