Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

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?

share|improve this question
    
You can also look at this command substitution guide –  Barun Dec 30 '13 at 17:22
add comment

marked as duplicate by manatwork, slm, terdon, Anthon, jw013 Dec 30 '13 at 17:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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
add comment

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