Библиотека сайта rus-linux.net
Chapter 5. Quoting
- Table of Contents
- 5.1. Quoting Variables
- 5.2. Escaping
Quoting means just that, bracketing a string in quotes. This has the effect of protecting special characters in the string from reinterpretation or expansion by the shell or shell script. (A character is "special" if it has an interpretation other than its literal meaning. For example, the asterisk * represents a wild card character in globbing and Regular Expressions).
|
Certain programs and utilities reinterpret or expand special characters in a quoted string. An important use of quoting is protecting a command-line parameter from the shell, but still letting the calling program expand it.
|
Note that the unquoted grep [Ff]irst *.txt
works under the Bash shell.
[1]
Quoting can also suppress echo's "appetite" for newlines.
|
Notes
[1] | Unless there is a file named
|