What does it mean in shell when we put a command inside dollar sign and parentheses: $(command)

Usage of the $ like ${HOME} gives the value of HOME. Usage of the $ like $(echo foo) means run whatever is inside the parentheses in a subshell and return that as the value. In my example, you would get foo since echo will write foo to standard out

Leave a Comment