fix bugs in examples
This commit is contained in:
parent
8acd8fb2da
commit
e156881d8c
|
@ -4,4 +4,4 @@ os:
|
|||
- linux
|
||||
|
||||
script:
|
||||
- shellcheck <(awk '/```sh/{f=1;next}/```/{f=0}f' README.md)
|
||||
- shellcheck -s bash --exclude=SC2034,SC2154 <(awk '/```sh/{f=1;next}/```/{f=0}f' README.md)
|
||||
|
|
15
README.md
15
README.md
|
@ -185,7 +185,7 @@ printf '%s\n' "${!var2}"
|
|||
# Assign to a variable named after the
|
||||
# value stored in '$var'.
|
||||
var="test"
|
||||
read -rp "input text: " "$var"
|
||||
read -rp "input text: " "${var?}"
|
||||
|
||||
# Access the variable indirectly.
|
||||
printf '%s\n' "set var \$$var to '${!var}'"
|
||||
|
@ -649,7 +649,18 @@ http://tldp.org/LDP/abs/html/internalvariables.html
|
|||
### Get the name of the current function.
|
||||
|
||||
```sh
|
||||
"$FUNCNAME"
|
||||
# Current function.
|
||||
"${FUNCNAME[0]}"
|
||||
|
||||
# Parent function.
|
||||
"${FUNCNAME[1]}"
|
||||
|
||||
# So on and so forth.
|
||||
"${FUNCNAME[2]}"
|
||||
"${FUNCNAME[3]}"
|
||||
|
||||
# All functions including parents.
|
||||
"${FUNCNAME[@]}"
|
||||
```
|
||||
|
||||
### Get the host-name of the system.
|
||||
|
|
Loading…
Reference in New Issue