-4

From bash manual

Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘‘’, ‘\’, and, when history expansion is enabled, ‘!’. The characters ‘$’ and ‘‘’ retain their special meaning within double quotes (see Section 3.5 [Shell Expansions], page 21).

What can single quote mean specially within double quotes?

The following example shows that single quotes within double quotes are treated literally not specially

$ echo "awk -F'[,/]' '{sub(/\/[0-9]*,/, "/" ($2+487) ",") }1' "
awk -F'[,/]' '{sub(/\/[0-9]*,/, / (+487) ,) }1' 

Thanks.

closed as unclear what you're asking by Gilles, Jeff Schaller, Stephen Harris, sam, Rahul Jul 20 '16 at 7:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What man page is that? Mine doesn't say anything about single quotes, nor does linux.die.net/man/1/bash – 123 Jul 19 '16 at 13:18
  • @spasic Those don't mention single quotes either (WRT double quoting and being special character). – 123 Jul 19 '16 at 13:33
  • @123 both the links I gave and QUOTING section in man bash say exceptions to be dollar, backtick and backslash.. I think OP mistook backtick as single quotes – Sundeep Jul 19 '16 at 13:41
  • 1
    Yep, they do, i also thought that, but in OP's post it is a single quote, not a backtick, which is why I was wondering what man page they got it from. – 123 Jul 19 '16 at 13:44
2

That's supposed to be a back-tick. In the online manual for bash "4.3.39(1)-release" it says:

Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, \, and, when history expansion is enabled, !. The characters $ and ` retain their special meaning within double quotes.

What you're seeing is an issue with the typographical markup of the paragraph.

  • Thanks. Does backtick '`' here indicate command expansion? – Tim Jul 27 '17 at 14:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.