The question is as simple as stated in the title: What’s the difference between the following two expressions?
$(...) `...`
For example, are the two variables test1 and test2 different?
test1=$(ls) test2=`ls`
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The result is the same, but the newer $() syntax is far clearer and easier to read. At least doubly so when trying to nest. Nesting is not easy with the old syntax, but works fine with the new.
Compare:
versus:
You need to escape the embedded backticks, so it’s quite a lot more complicated to both type and read.
According to this page, there is at least one minor difference in how they treat embedded double backslashes.