Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 2
    Note that this outputs Nice! if the user enters qwerty, but also if they enter " qwerty " (leading or trailing space or tabs with the default value of $IFS) or q\w\e\r\t\y... See Understanding "IFS= read -r line", and also if they enter -d / -o y as your forgot to quote $password. Commented Apr 19, 2018 at 10:11
  • Besides the quoting issue raised by Stéphane (serious hole, btw, as it doesn't really matter what the password is), it would also be better if you do stty -echo before the read and stty echo after it, so the password is not displayed in the terminal. Commented Apr 19, 2018 at 17:11