Skip to content

Instantly share code, notes, and snippets.

@dienncrelipa
Last active September 24, 2018 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dienncrelipa/711e3c665281b6acf19f23eaabeb74a5 to your computer and use it in GitHub Desktop.
Save dienncrelipa/711e3c665281b6acf19f23eaabeb74a5 to your computer and use it in GitHub Desktop.
exp bash
#!/usr/bin/expect -f
set timeout 3
set cmd [lrange $argv 1 end]
set password [lindex $argv 0]
eval spawn $cmd
expect "password:"
send "$password\r";
expect eof
expect wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment