Quotes (Shell Scripting)

The two types of quotes in shell scripts are single quotes ' and double quotes ". Both are used whenever you want to include spaces in a given parameter or expression. The difference is that double quotes have variable replacement while single quotes do not. For example, given the following code…



echo "Myvar is $myvar"
echo 'Myvar is $myvar'
echo Myvar is $myvar

…the result is…

Myvar is 7
Myvar is $myvar
Myvar is 7
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License