Is there a way to validate or confirm that the user wrote what it meant to write in read
?
For example, the user meant to write "Hello world!" but mistakenly wrote "Hello world@".
This is very similar to contact-form validation of an email / phone field.
Is there a way to prompt the user with something like "Please retype the input", in read?
I found no such option in man read
.
Note: The input is a password so I don't want to print or compare it with an already existing string.
printf
in between to tell them you are doing soread
twice doesn't make sure the second input is identical to the first.