mirror of https://github.com/tLDP/LDP
16 lines
512 B
Bash
16 lines
512 B
Bash
#!/bin/bash
|
|
# erase.sh: Using "stty" to set an erase character when reading input.
|
|
|
|
echo -n "What is your name? "
|
|
read name # Try to backspace
|
|
#+ to erase characters of input.
|
|
# Won't work.
|
|
echo "Your name is $name."
|
|
|
|
stty erase '#' # Set "hashmark" (#) as erase character.
|
|
echo -n "What is your name? "
|
|
read name # Use # to erase last character typed.
|
|
echo "Your name is $name."
|
|
|
|
exit 0
|