Skip to content

Instantly share code, notes, and snippets.

@TooTallNate
Created April 7, 2012 20:38
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 TooTallNate/681256e480d4e8eae52d to your computer and use it in GitHub Desktop.
Save TooTallNate/681256e480d4e8eae52d to your computer and use it in GitHub Desktop.
`node < /dev/tty` doesn't work?!?
☮ ~ (master) ⚡ cat read.sh
while [ "$OK" != "y" ] && [ "$OK" != "yes" ] && [ "$OK" != "no" ]; do
echo "Is this OK?"
echo " enter 'yes' or 'no'"
echo " or 'show' to see a list of files "
read OK
done < /dev/tty
☮ ~ (master) ⚡ cat read.sh | sh
Is this OK?
enter 'yes' or 'no'
or 'show' to see a list of files
Is this OK?
enter 'yes' or 'no'
or 'show' to see a list of files
ye
Is this OK?
enter 'yes' or 'no'
or 'show' to see a list of files
yes
☮ ~ (master) ⚡ echo "node < /dev/tty"
node < /dev/tty
☮ ~ (master) ⚡ echo "node < /dev/tty" | sh
>
sl
process
.exit
WTF?!?!
^C☮ ~ (master) ⚡
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment