1

Does the operator

$()

issued in a terminal window have a specific name?

What's the exact meaning of this operator, I suppose it's a sort of Evaluate... but I'm not sure this is covering all its applications

For instance I know that

 cd $(brew --prefix)  

will evaluate the install path of brew to cd to it

This is the typical question that could be solved by googling but... googling a symbol without knowing the name ...

koalaok
  • 5,075
  • 11
  • 47
  • 91

1 Answers1

1

That is simply bash syntax for "command substitution" that specifies that the output of the command inside the $() will be evaluated and then replaced.

So in this case the output from 'brew --prefix' will be returned and added to the cd command.

It is equivalent to the use of backtics. For example:

echo `date`

There is quite a bit more about both syntactical options here.

Community
  • 1
  • 1
gview
  • 14,876
  • 3
  • 46
  • 51