I need to look for a CLI prompt. But how do I tell the difference between the initial login vs. subsequent prompts (after the successful completion of a CLI command)?
Presumably, you have used telnet/ssh to manually log in to the switch to run commands. Is the CLI prompt really identical to the login prompt? What about text that precedes the prompts? Often there is some kind of "welcome" text before the login prompt.
If there's really no difference in the prompts and no other text you can look for, then just issue the command and look for another prompt. Then assume it is a CLI prompt and issue the next command.