Skip to content

Instantly share code, notes, and snippets.

@thinkerbot
Created October 25, 2012 03:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkerbot/3950215 to your computer and use it in GitHub Desktop.
Save thinkerbot/3950215 to your computer and use it in GitHub Desktop.
Expect examples
#!/bin/bash
# works
cat > example <<SCRIPT
#!/usr/bin/env expect -f
spawn irb
interact
SCRIPT
chmod +x example
./example
# works (BASH)
expect <(printf "\
spawn irb
interact
")
# does NOT work -- stdin isn't a tty!!
expect - <<SCRIPT
spawn irb
interact
SCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment