- $(command) is replaced by the output of command, which runs in a
subshell (gosh -c), so cd/set in it do not change the shell
- trailing newlines are removed; unquoted the output is split into words
at blanks and newlines, "$(...)" stays one word; wildcards in the
output are not expanded
- nested substitutions, quotes and operators inside are handled; the
list, alias and brace scanners skip $(...) as a whole
- a command that consists only of a substitution has its exit status,
Ctrl+C in a substitution aborts the command
- $((...)) is reported as not supported
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>