I'm trying to any read user input keys in verbatim from Bash script, and then dump it into hex. That is:
read input
printf "%b" "$input" | xxd -p
If user press 2 keys a BACKSPACE, I would hope the output to be 617f
, not empty.
How can I achieve that?
This should work
You can put a condition on the loop to exit the loop/program, otherwise you will need to use CTRLC` to exit.
This should print every key press except for CTRLC and CTRLz.