Jump to navigation Jump to search
9 bytes added ,  16:29, 19 October 2009
|Double QuotesThe double quote
|The double quote ( "quote" ) protects everything enclosed between two double quote marks except $, ', " and \.Use the double quotes when you want only '''variables and command substitution'''.<br/>* '''Variable''' - Yes<br/>* '''Wildcards''' - No<br/>* '''Command substitution''' - yes
|The double quotes allowes to print the value of $SHELL variable, disables the meaning of [[wildcards]], and finally allows command substitution.<br/><code>echo "$SHELL"<br/>echo "/etc/*.conf"<br />echo "Today is $(date)"</code><br />&nbsp;
|Single quotes The single quote
|The single quote ( 'quote' ) protects everything enclosed between two single quote marks. It is used to '''turn off the special meaning''' of all characters.<br/>* '''Variable''' - No<br/>* '''Wildcards''' - No<br/>* '''Command substitution''' - No
| The single quotes prevents displaying variable $SHELL value, disabled the meaning of [[wildcards]] /etc/*.conf, and finally command substitution ($date) itself. <br/><code>echo '$SHELL'<br/>echo '/etc/*.conf'<br />echo 'Today is $(date)'</code><br />&nbsp;
|BackslahsThe Backslash
|Use backslahs to change the special meaning of the characters or to escape special characters within the text such as quotation marks.
|You can use \ before dollar sign is used to told to have no special meaning. Disable the meaning of the next character in $PATH (i.e. do not display value of $PATH variable):<br/><code>echo "Path is \$PATH"<br />echo "Path is $PATH"<br />&nbsp;

Navigation menu