Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 852 Bytes

command_substitution.md

File metadata and controls

38 lines (25 loc) · 852 Bytes

Command Substitution

  • $(command) or `command`
  • Command substitution allows the output of a command to replace the command itself.
  • Useful to assign output of a command to a variable

Example 1

filename

#### Demo 1

bash ./examples/subshell/command_substitution.sh

Example 2

filename

#### Demo 2

bash ./examples/subshell/assingment_to_var.sh

Example 3

filename

#### Demo 3

bash ./examples/subshell/stderr_redirection.sh






### References