From fe6c6a7677b6fd3543d05f367480998271dcef38 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 19 Sep 2019 12:01:15 +0300 Subject: [PATCH] docs: update --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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)")" +```