3 ms·
I’ll nitpick. I think > # Ask for only a single character of input, so the user does not need to type an extra enter plus > echo "Please answer by typing n (
by scintill76 6y ago
I’ll nitpick. I think
> # Ask for only a single character of input, so the user does not need to type an extra enter
plus
> echo "Please answer by typing n (for no), y (for yes), or Enter (also for yes)"
seem like it will lead to “y[enter]” so you accidentally accept a second line before you read it.
- macintux 6y agoIn addition, for security reasons I think you’d want the default behavior to be no, not yes. Seems like dropping enter entirely is the right choice.