Needs bash and gawk, bash you can avoid by changing<p>cmd = &quot;bash -c &#x27;read -n 1 input; echo $input&#x27;&quot;<p>to<p>cmd = &quot;saved=$(stty -g); stty raw; var=$(dd bs=1 count=1 2&gt;&#x2F;dev&#x2F;null); stty \&quot;$saved\&quot;; echo \&quot;$var\&quot;&quot;<p>all credit to izabera from #bash on freenode