Escaping

Using escaping with backslashes, the examples from the previous section can be correctly written like this:

$ touch important\ files
$ touch Testfile\<Tom\>.doc
$ touch Review\;Final.doc
$ touch \$\$\$Money.doc

A backslash can escape another backslash, too:

$ echo \\backslash\\
\backslash\

However, it can't escape a newline within a word:

$ echo backslash\
> foo\
> bar
backslashfoobar

Get Bash Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.