So I am attempting to use expect to automate backing up the running config of some switches on our network. The problem that I'm running into is its changing a part of my send commands and I dont know how to fix it.
For example I'm using whats below.
#/usr/bin/expect
spawn /usr/bin/plink -ssh x.x.x.x
expect -exact "User Name:"
send "USERNAME\r"
expect -exact "Password:"
send "PASSWORD\r"
send "copy running-config flash:\\startup-config"
expect "Overwrite file [startup-config] ?[Yes/Press any key for no]"
send "y\r"
expect "Copy succeeded"
send "exit/r"
expect "eof"
but it ends up messing up on "flash:\\startup-config" instead sending "flash:\startup-config" and I'm at a loss as to what this is called (in order to search how to fix it).
Is anyone able to help with pointing me in the right direction?