I am looking to automate ssh on multiple cisco switches with bash script, and after the login, can execute commands, like:
Anybody know if there are some good scrips, or examples anywhere to get me started?
Many thanks in advance
Does it have to be shell script because for this sort of thing Python is becoming the choice of scripting language.
There is also a module written for Python called Netmiko which deals specifically for automating logging into network devices -
Difficult to say without understanding what OS you are trying it on, what the error message was etc.
You can find examples of using shell scripts with a bit of searching but honestly sorting out your Python install would make a lot more sense in the long run if you want to look at more automation.