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:

3.1.2.2 single quotes

enclosing characters in single quotes (') preserves literal value of each character within quotes. single quote may not occur between single quotes, when preceded backslash.

3.1.2.3 double quotes

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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -