2

Both give the output of the command, so what is the semantic difference between the two? Some reading led me to suspect is that $(command) is Bash syntax, and the back quotes are integrated into Unix somehow; is there any truth to this?

derobert
  • 109,670
aenda
  • 123

1 Answers1

4

The two have identical semantics. Backquotes were the earlier form of command substitution, but they are difficult to nest since the opening and closing delimiters are identical, requiring lots of escaping. $(...) solves that problem, as well as being more readable in certain fonts.

chepner
  • 7,501
  • Thanks for your reply. I tried searching for duplicate questions, but google doesn't really play nice with lesser-used characters. – aenda Dec 30 '13 at 19:25