Added method of getting function names.
This commit is contained in:
parent
5f61ee3885
commit
aa490304ef
11
README.md
11
README.md
|
@ -127,6 +127,7 @@ scripts and not full blown utilities.
|
|||
* [Check if a program is in the user's PATH.](#check-if-a-program-is-in-the-users-path)
|
||||
* [Get the current date using `strftime`.](#get-the-current-date-using-strftime)
|
||||
* [Progress bars.](#progress-bars)
|
||||
* [Get the list of functions from your script.](#get-the-list-of-functions-from-your-script)
|
||||
* [Bypass shell aliases.](#bypass-shell-aliases)
|
||||
* [Bypass shell functions.](#bypass-shell-functions)
|
||||
|
||||
|
@ -754,7 +755,6 @@ done
|
|||
shopt -u globstar
|
||||
```
|
||||
|
||||
|
||||
# File handling
|
||||
|
||||
**CAVEAT:** `bash` doesn't handle binary data properly in versions `< 4.4`.
|
||||
|
@ -1520,6 +1520,15 @@ done
|
|||
printf '\n'
|
||||
```
|
||||
|
||||
## Get the list of functions from your script.
|
||||
|
||||
```sh
|
||||
get_functions() {
|
||||
# Usage: get_functions
|
||||
IFS=$'\n' read -d "" -ra functions < <(declare -F)
|
||||
printf '%s\n' "${functions[@]//declare -f }"
|
||||
}
|
||||
```
|
||||
|
||||
## Bypass shell aliases.
|
||||
|
||||
|
|
Loading…
Reference in New Issue