Quoting

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 ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The 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.