When I login to one of our servers I'm prompted with:
Please select the system to work with:
1: system1 (user u1)
2: system2 (user u1)
3: system3 (user u2)
Enter your choice (1-3) [1]:
and I need to enter "1" before any command is to be executed, right after login. Can I automatically respond via fabric to such prompts? Other boxes could have login without prompt, so it's only one of the possible situations. Something like this is desired:
if prompt("Enter your choice (1-3) [1]:"):
response("1")
run(command)
How can this be done? I read Interaction with remote programs, however didn't find any useful example. i'd prefer to use only fabric, not to involve another modules if it's possible.