Command Substitution

Chester Wyke December 29, 2023 Updated: April 26, 2025 #Bash

Source: http://mywiki.wooledge.org/CommandSubstitution

Inserts the output of one command into another command.

echo $(pwd)

Example Output: /home/user

NB: Older shells seemed to have only supported ` but $() is preferred.