mirror of
https://github.com/dylanaraps/pure-bash-bible.git
synced 2025-09-09 22:51:16 +02:00
docs: update
This commit is contained in:
@@ -641,6 +641,8 @@ fi
|
|||||||
Enabling `extdebug` allows access to the `BASH_ARGV` array which stores
|
Enabling `extdebug` allows access to the `BASH_ARGV` array which stores
|
||||||
the current function’s arguments in reverse.
|
the current function’s arguments in reverse.
|
||||||
|
|
||||||
|
**CAVEAT**: Requires `shopt -s compat44` in `bash` 5.0+.
|
||||||
|
|
||||||
**Example Function:**
|
**Example Function:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
2
test.sh
2
test.sh
@@ -69,8 +69,10 @@ test_urldecode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test_reverse_array() {
|
test_reverse_array() {
|
||||||
|
shopt -s compat44
|
||||||
IFS=$'\n' read -d "" -ra result < <(reverse_array 1 2 3 4 5)
|
IFS=$'\n' read -d "" -ra result < <(reverse_array 1 2 3 4 5)
|
||||||
assert_equals "${result[*]}" "5 4 3 2 1"
|
assert_equals "${result[*]}" "5 4 3 2 1"
|
||||||
|
shopt -u compat44
|
||||||
}
|
}
|
||||||
|
|
||||||
test_remove_array_dups() {
|
test_remove_array_dups() {
|
||||||
|
Reference in New Issue
Block a user