shell - Difference between single and double quotes in Bash -
in bash, differences between single quotes (''
) , double quotes (""
)?
single quotes won't interpolate anything, double quotes (for example variables, backticks, \
escapes, etc...)
the bash manual has say:
enclosing characters in single quotes (
'
) preserves literal value of each character within quotes. single quote may not occur between single quotes, when preceded backslash.enclosing characters in double quotes (
"
) preserves literal value of characters within quotes, exception of$
,`
,\
, and, when history expansion enabled,!
. characters$
,`
retain special meaning within double quotes (see shell expansions). backslash retains special meaning when followed 1 of following characters:$
,`
,"
,\
, or newline. within double quotes, backslashes followed 1 of these characters removed. backslashes preceding characters without special meaning left unmodified. double quote may quoted within double quotes preceding backslash. if enabled, history expansion performed unless!
appearing in double quotes escaped using backslash. backslash preceding!
not removed.the special parameters
*
,@
have special meaning when in double quotes (see shell parameter expansion).
Comments
Post a Comment