Bash $() and ()

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Internal

Overview

(...) executes the command into a subshell:

(ls -al)

If the command executes as such invokes exit, the calling shell does not exit.

$(...) is the syntax for command substitution. More details about command substitution are available here:

bash Command Substitution