Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
`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
You can’t perform that action at this time.