Skip to content

Instantly share code, notes, and snippets.

@cggaurav
Created December 12, 2016 16:17
Show Gist options
  • Save cggaurav/c60d9cf8c6a4a8a39ee918eebb946a3e to your computer and use it in GitHub Desktop.
Save cggaurav/c60d9cf8c6a4a8a39ee918eebb946a3e to your computer and use it in GitHub Desktop.
Writing 'expect' scripts for CLI
#!/usr/bin/expect
set timeout 300
set MODULUS ../bin/modulus
set USERNAME brandon@modulus.io
set PASSWORD qwerty
spawn $MODULUS login
expect {
"email:" {send "$USERNAME\r"}
}
expect {
"password:" {send "$PASSWORD\r"}
}
expect {
"brandon@modulus.io" {send "\r"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment