echo "Enter name:" read name
echo "Enter name:" read -r name
By default, read will interpret backslashes before spaces and line feeds, and otherwise strip them. This is rarely expected or desired.
read
Normally you just want to read data, which is what read -r does. You should always use -r unless you have a good reason not to.
read -r
-r
Note that read -r will still strip leading and trailing spaces. IFS="" read -r prevents this.
IFS="" read -r
If you want backslashes to affect field splitting and line terminators instead of being read, you can disable this message with a directive.
There was an error while loading. Please reload this page.