Changes

Jump to navigation Jump to search
448 bytes added ,  14:43, 12 September 2009
no edit summary
! style="background:#ffdead;"| Name
! style="background:#ffdead;"| Meaning
! style="background:#ffdead;"| Example(type at shell prompt)
|-
|"
|Double Quotes
|The double quote ( "quote" ) protects everything enclosed between two double quote marks except $, ', " and \.<br/>Use the double quotes when you want only '''variables and command substitution'''.|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 ( 'quote' ) protects everything enclosed between two single quote marks.<br/>It is used to '''turn off the special meaning''' of all characters.|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;
|-
|`
|Back quote
|Use back quote ( `command-name` ) to '''execute command''' and replace a command with its output<br/> within the same command-line. However, ''$(command-name)'' is encouraged syntax for substitution as it is recommended<br/> by [[POSIX]] standard and it improves script readability. |The [[date command]] is executed and its output is substituted back to [[echo command]].<br/><code>echo "Today is `date`"<br />echo "Today is $(date)"</code><br />&nbsp;
|-
|}

Navigation menu