Relative Content

Tag Archive for bashuser-inputspecial-charactersreal-timeansi-escape

How to filter password user input char-wise for special characters, suppressing ESC sequences in Bash?

I’m trying to find a solution which can filter user input for a password char-wise via read command (not by read -e, which prevents directly responding to key strokes), filtering and handling special characters in real-time. As first char, space or any special chars shouldn’t be allowed. How to achieve that, yet avoiding non-printable ESC-sequences (everything which moves the cursor, apart from backspace), which potentially would pollute the password input?

How to filter char-wise user input for special characters, suppressing ESC sequences in Bash

I’m trying to find a solution which can filter user input for a password char-wise via read command (not by read -e, which prevents directly responding to key strokes), filtering and handling special characters in real-time. As first char, space or any special chars shouldn’t be allowed. How to achieve that, yet avoiding non-printable ESC-sequences (everything which moves the cursor, apart from backspace), which potentially would pollute the password input?