Bash - Subshell ()

About

Subshell (a shell started from a shell with its own scope).

Example

  • $(command) will capture the standard stream.
  • (command) will execute without capturing the standard stream.
foo() {
    >&2 echo "std error";
    echo "std out";
}

echo $(foo)
std error
std out

Powered by ComboStrap