Revision 10064
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
156 | 156 |
} |
157 | 157 |
alias foreach_arg='"foreach_arg" "$@"; set -- "${args[@]}"; unset args' |
158 | 158 |
|
159 |
alias self='command "${FUNCNAME%%__*}"' # usage: wrapper() { self ...; } |
|
160 |
alias self_sys='sys_cmd "${FUNCNAME%%__*}"' # wrapper() { self_sys ...; } |
|
159 |
alias self_name='echo "${FUNCNAME%%__*}"' # usage: "$(self_name)" |
|
161 | 160 |
|
161 |
alias self='command "$(self_name)"' # usage: wrapper() { self ...; } |
|
162 |
alias self_sys='sys_cmd "$(self_name)"' # wrapper() { self_sys ...; } |
|
163 |
|
|
162 | 164 |
pf() { declare -f "$@"; } # usage: pf function # prints func decl for debugging |
163 | 165 |
|
164 | 166 |
all_funcs() # usage: for func in $(all_funcs); do ...; done # all declared funcs |
Also available in: Unified diff
lib/sh/util.sh: added self_name alias and use it in self/self_sys