sh Quoting Escaping


\ 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-quotes inside of a '\''single-quoted'\'' string'
single-quotes inside of a 'single-quoted' string
$ printf format\ with\ %s spaces
format with spaces
$ printf %s\\n \$var

Removing newlines:

$ echo multi\
> -line