As mentioned in several forums and here, on stackoverflow, there’s no difference between these two ways of command substituion in shell.
But, there is. Here is a real example:
# this command works fine:
$(cat $LOG_FILE | gawk "(\$1 \$2) > $TIME")
# this one does not:
`cat $LOG_FILE | gawk "(\$1 \$2) > $TIME"`
And the whole thing behind this is that when bash sees a first
`, it tries to find another one, substituting all\$, \` and \\on its way,which leads to replacing
\$1with$1, and then,when substituting everything inside a
"...",$1is no longer escaped and is treated as the first agrument in a shell script itself (which is an empty string in my case) instead of being passed as$1to gawk as is.This is another reason for not using
`...`in shell.