in reply to Custom prompts for Net::Appliance::Session
G'day edimusrex,
I've never used any of these modules; however, as your question has been sitting there for over 12 hours without a reply, I thought I'd have a look.
In Net::CLI::Interact::Phrasebook, under the PHRASEBOOK FORMAT section, it has:
"Try to make the Prompt as specific as possible, including line-end anchors."
All the examples show that anchor. Here's the first two match examples:
match /\(config[^)]*\)# ?$/ match /> ?$/
And one further down is very close to your password prompt:
match /[Pp]assword: ?$/
So instead of
match /User Name/ match /Password/
maybe try
match /User Name: ?$/ match /Password: ?$/
You might also want to scrutinise your expected prompts for case and whitespace. For instance, perhaps this would work better for the username prompt:
match /[Uu]ser\s*[Nn]ame:\s*?$/
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Custom prompts for Net::Appliance::Session
by edimusrex (Monk) on Sep 15, 2017 at 14:52 UTC | |
by kcott (Archbishop) on Sep 16, 2017 at 03:31 UTC | |
|
Re^2: Custom prompts for Net::Appliance::Session
by edimusrex (Monk) on Sep 15, 2017 at 14:33 UTC |