1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh restore() { if [ -n "$stty" ] ; then stty "$stty" fi } trap restore EXIT if [ -t 0 ] ; then stty=$(stty -g) stty -echo fi cat