Expect is…
• surprisingly easy to learn
• powerful
• easily available (installed by default on OS X)
• does not replace scripting, use it for small % of tasks
Slide 6
Slide 6 text
Demo
automating ssh tasks
Slide 7
Slide 7 text
Commands summary
• spawn - starts a program
• expect - “listens” for output
• send - “types” program input
• interact - gives control to the user
Slide 8
Slide 8 text
Commands summary
• log_user 0 - make the script quiet
• puts - print to the screen
• set timeout 10
…
timeout { exit 1 }
Slide 9
Slide 9 text
My real-world usage
examples
• Ericsson NT - automating SSH connections (3-4 hops)
• Automated testing for tmux plugins
• tmux plugin manager
• tmux copycat