bash expect: script to handle command line prompts
Aug.28, 2009 in
Think Linux, Think Networking
expect is very useful to automate login process. I thought it is helpful when doing testing as well. A simple login script might work like this:
#!/usr/bin/env expect eval spawn "/path/program" expect "^Enter Auth Username:" send "user\n" expect "Enter Auth Password:" send "password\n"
To install expect, “yum install expect”












Leave a Reply