Tutorial by Examples

Single-quotes are literal strings, and the lack of escape characters means that the only character that can not occur inside of a single-quoted string is a single-quote. $ echo '$var \$var \\$var \\\$var' $var \$var \\$var \\\$var $ echo '"quoted string"' "quoted string" $ e...
Double-quotes preserve all characters other than " terminator, $ expansions, ` command substitutions, and \ escapes of any of these characters (and newline removal). Note that the literal \ is preserved unless followed by a special character. General escapes: $ printf "\"quoted str...
\ escapes preserve the following character value, unless the following character is a newline in which case both the \ and the newline are removed. Escaping special characters: $ echo \"quoted text\" "quoted text" $ echo \`\`quoted text\'\' ``quoted text'' $ echo 'single-qu...

Page 1 of 1