docs: update
This commit is contained in:
19
README.md
19
README.md
@@ -49,6 +49,8 @@ A collection of pure POSIX `sh` alternatives to external processes
|
|||||||
* [TRAPS](#traps)
|
* [TRAPS](#traps)
|
||||||
* [Do something on script exit](#do-something-on-script-exit)
|
* [Do something on script exit](#do-something-on-script-exit)
|
||||||
* [Ignore terminal interrupt (CTRL+C, SIGINT)](#ignore-terminal-interrupt-ctrlc-sigint)
|
* [Ignore terminal interrupt (CTRL+C, SIGINT)](#ignore-terminal-interrupt-ctrlc-sigint)
|
||||||
|
* [OBSOLETE SYNTAX](#obsolete-syntax)
|
||||||
|
* [Command Substitution](#command-substitution)
|
||||||
|
|
||||||
<!-- vim-markdown-toc -->
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
@@ -546,3 +548,20 @@ trap clean_up EXIT
|
|||||||
```shell
|
```shell
|
||||||
trap '' INT
|
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)")"
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user