How can i execute the next command on a cli depending upon the prompt i get?
For example when login to my device, sometimes it asks for login and password and sometimes it gives me the # prompt to enter my commands skipping the login.
I want to say if prompt is "login:" then enter loginname and password and if prompt is # then enter some cli command.