Skip to content

Instantly share code, notes, and snippets.

@dualbus
Created June 26, 2014 17:53
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 dualbus/e085469b7b3305562eb7 to your computer and use it in GitHub Desktop.
Save dualbus/e085469b7b3305562eb7 to your computer and use it in GitHub Desktop.
#!/bin/bash
stty=$(stty -g)
trap 'stty "$stty"' EXIT
stty raw
IFS= read -rs -N1 a
while read -t0; do
IFS= read -rs -N1 b
a+=$b
done
stty "$stty"
printf '%q\n' "$a"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment