shell delete characters you entered when reading input from the keyboard

[Article] Reference: stty command usage of the whole solution

[Article] Reference: shell - Backspace abnormal when read (shell modified to delete character )

  stty srase ^h

  read -p "Enter parameter information"

  Add stty erase ^ h command before the read command can be used normally to delete characters operate in the input parameters, and will not appear ^ H characters.

  When a read command -n 3 parameter (limit input indicates three characters), stty command will fail.

Guess you like

Origin www.cnblogs.com/virgosnail/p/11654650.html