Quoting
Quoting disables a character’s special meaning and allows it to be used literally, as itself. The characters in the following table have special meaning to tcsh .
|
Characters |
Description |
|
|
Command separator |
|
|
Background execution |
|
|
Command grouping |
|
|
Pipe |
|
|
Filename metacharacters |
|
|
String expansion characters (usually don’t require quoting ) |
|
|
Redirection symbols |
|
|
History substitution, quick substitution |
|
|
Used in quoting other characters |
|
|
Command substitution |
|
|
Variable substitution |
|
|
Word separators |
The characters that follow can be used for quoting:
-
" " Everything between
"and"is taken literally except for the following characters, which keep their special meaning:-
$ Variable substitution will occur.
-
' Command substitution will occur.
-
" The end of the double quote.
-
\ Escape next character.
-
! The history character.
-
newline The newline character.
-
-
' ' Everything between
'and'is taken literally except for!(history), another', and newline.-
\ The character following a
\is taken literally. Use within" "to escape",$,', and newline. Use within' 'to escape newlines. Often used to escape itself, spaces, or newlines. Always needed to escape a history character (usually!).
Examples
%echo 'Single quotes "protect" double quotes'Single quotes "protect" double quotes %echo "Don't double quotes protect single quotes too?"Don't double quotes protect single quotes too? %
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access