backslash
The \ character, which in the shell quotes exactly the one character that follows it.
In more detail
two\ words is one word with a space in it, and \* is a literal star. A backslash at the very end of a line joins it to the next line. read without the -r option treats backslashes as escapes and removes them, which is why the course always writes read -r.
Related terms
- quoting — Marking characters so the shell treats them as plain text instead of as special syntax, using single quotes, double quotes or a backslash.
- read builtin — The bash builtin that reads one line of input and stores it, or its fields, in variables.
- escape sequence — A backslash followed by a character that together stand for something hard to type directly, such as \n for a line break.
Taught in
- Single Quotes, Double Quotes, Backslash — Bash Scripting & Command Line Automation
- The Field Separator, And Reading Lines Safely — Bash Scripting & Command Line Automation
- Finding Lines: grep And Regular Expressions — Bash Scripting & Command Line Automation
- Command Substitution And Subshells — Bash Scripting & Command Line Automation
- Script Input And Output: read, Heredocs, printf — Bash Scripting & Command Line Automation
- Style That Prevents Bugs — Bash Scripting & Command Line Automation
- eval, And What To Use Instead — Bash Scripting & Command Line Automation