January 2001
Intermediate to advanced
480 pages
7h 22m
English
Quotes are used when assigning values containing whitespace or special characters, to delimit parameters and variables, and to assign command output.
There are three types of quotes: single quotes, double quotes, and back quotes. Single and double quotes are similar, except for the way they handle some special characters. Back quotes are used for command output assignment.
Look what happens when you try to perform a variable assignment using a value that contains whitespace without enclosing it in quotes:
$ GREETING=Hello world /bin/ksh: world: not found $ print $GREETING $
No assignment is made. To assign Hello world to GREETING, you would need to enclose the entire string in quotes, like this:
$ GREETING='Hello world' $ print $GREETING ...
Read now
Unlock full access