Revision 8909
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/util.sh | ||
---|---|---|
89 | 89 |
echo "$path" |
90 | 90 |
} |
91 | 91 |
|
92 |
fi # allow unalias to take effect |
|
93 |
unalias echo_func |
|
92 |
fi # load new aliases |
|
94 | 93 |
if self_being_included; then |
95 | 94 |
|
96 |
echo_func () |
|
95 |
function echo_func ()
|
|
97 | 96 |
{ |
98 | 97 |
inc_log_level |
99 | 98 |
local script="$(canon_rel_path "${BASH_SOURCE[1]}")" |
100 | 99 |
echo_cmd "$script:${BASH_LINENO[0]}" "${FUNCNAME[1]}" "$@" |
101 | 100 |
} |
102 | 101 |
|
103 |
fi # always restore the alias |
|
104 |
alias echo_func='"echo_func" "$@"' # usage: func () { echo_func; ...; } |
|
105 |
if self_being_included; then |
|
106 |
|
|
107 | 102 |
echo_stdin () # usage: input|echo_stdin|cmd |
108 | 103 |
{ |
109 | 104 |
inc_log_level |
Also available in: Unified diff
lib/util.sh: echo_func (): use the much simpler function keyword to avoid expanding the echo_func alias when defining the function, rather than going through the complex process of unaliasing and realiasing the echo_func alias