I thought I ddcould do this, so I tried it and I won’t go anywhere. However, Google found this one for me, and I adapted it here:
readOne () {
local oldstty
oldstty=$(stty -g)
stty -icanon -echo min 1 time 0
dd bs=1 count=1 2>/dev/null
stty "$oldstty"
}
script, :
char=$(readOne)
echo $char