File globbing : Command Substitution - Explained

Command Substitution

command substitution allows the output of a command to replace the command itself. Command substitution occurs when a command is enclosed with a beginning dollar sign and parenthesis, $(command), or with back-ticks, 'command' . The form with back-ticks is older, and has two disadvantages;


  1. it can be easy to visually confuse back-ticks with single quote marks
  2. back-ticks cannot be nested inside back-ticks.
The $(command) form can nest multiple command expansions inside each other.


date +%A

echo The time is $(date +%M) minutes past $(date +%I%p)

 File globbing : Command Substitution - Explained




Tech info

Comments