What is the benefit of using $() instead of backticks in shell scripts? [duplicate]
The major one is the ability to nest them, commands within commands, without losing your sanity trying to figure out if some form of escaping will work on the backticks. An example, though somewhat contrived: deps=$(find /dir -name $(ls -1tr 201112[0-9][0-9]*.txt | tail -1l) -print) which will give you a list of all files in … Read more