diff options
| author | Marc Vertes <mvertes@free.fr> | 2025-07-29 20:11:46 +0200 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2025-07-29 20:11:46 +0200 |
| commit | 30a3865247db70d55eedb200a2175747f38c4143 (patch) | |
| tree | f283a6fa628e43a611d26bf9265f26612cf168e0 /xx | |
| parent | b4eb1e9ae2fed94726699d5e0a47542dbce5fbc1 (diff) | |
fixup
Diffstat (limited to 'xx')
| -rwxr-xr-x | xx | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -0,0 +1,28 @@ +#!/bin/bash + +trap 'stty $ttysave' EXIT INT TERM +ttysave=$(stty -g) + + stty raw -echo + +while true +do + read -n1 char + echo "$char" +done | +awk ' +/q/ {exit} +{printf "[%s]", $0; fflush} +' + +exit + +awk 'BEGIN { + cmd = "dd bs=1 count=1 2>/dev/null" + for (;;) { + cmd | getline ch + close(cmd) + if (ch == "q") exit + printf("[%s]", ch) + } +}' |
