diff --git a/README.md b/README.md index 6d4052c..7c99062 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ A collection of pure POSIX `sh` alternatives to external processes * [TRAPS](#traps) * [Do something on script exit](#do-something-on-script-exit) * [Ignore terminal interrupt (CTRL+C, SIGINT)](#ignore-terminal-interrupt-ctrlc-sigint) +* [OBSOLETE SYNTAX](#obsolete-syntax) + * [Command Substitution](#command-substitution) @@ -546,3 +548,20 @@ trap clean_up EXIT ```shell trap '' INT ``` + +# OBSOLETE SYNTAX + +## Command Substitution + +Use `$()` instead of `` ` ` ``. + +```shell +# Right. +var="$(command)" + +# Wrong. +var=`command` + +# $() can easily be nested whereas `` cannot. +var="$(command "$(command)")" +```