-3

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.

  • 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.

| improve this answer | |
  • 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.