Skip to content

Instantly share code, notes, and snippets.

@zhenguoli
zhenguoli / detecting_key-presses.sh
Last active April 27, 2017 13:06
Advanced Bash-Script Guide Example 5-3. Detecting key-presses
#!/bin/bash
# Author: Sigurd Solaas, 20 Apr 2011
# Used in ABS Guide with permission.
# Requires version 4.2+ of Bash.
key="no value yet"
while true; do
clear
echo "Bash Extra Keys Demo. Keys to try:"
echo