Reputation:
What does it do? Does it named "magic quotes"?
`
(to type this use the key left of "1" on the keyboard)
Are the
``
expression is equivalent to
$()
?
Upvotes: 0
Views: 826
Reputation: 140477
The syntax you are referring to is called Command Substitution and yes the two versions of the syntax are functionally identical, see HERE for the POSIX spec.
Note that $()
is favored over the backticks because it's much easier to read and it can nest within itself much easier than the backtick version.
As for what it does in, it essentially allows you to capture the output of a shell command in a variable. For example:
$ myDate=$(date); echo "Today's date is -->$myDate<--"
Today's date is -->Mon Mar 28 23:49:20 PDT 2011<--
Upvotes: 2