Command Substitution

Chester Wyke December 29, 2023 Updated: April 15, 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.