Revision 9075
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/runscripts/table.run | ||
---|---|---|
28 | 28 |
input_make() |
29 | 29 |
{ |
30 | 30 |
echo_func |
31 |
extern make --directory="$top_dir"/.. "${@/#/$table/}"
|
|
31 |
command make --directory="$top_dir"/.. "${@/#/$table/}"
|
|
32 | 32 |
} |
33 | 33 |
|
34 | 34 |
map_table() |
lib/sh/util.sh | ||
---|---|---|
4 | 4 |
if test ! "$_util_sh_include_guard_utils"; then |
5 | 5 |
_util_sh_include_guard_utils=1 |
6 | 6 |
|
7 |
function extern() { (exec "$@") || return; } |
|
8 |
|
|
9 | 7 |
isset() { test "${!1+isset}"; } |
10 | 8 |
|
11 | 9 |
realpath() { readlink -f -- "$1"; } |
12 | 10 |
|
13 |
include_guard_var() { realpath "$1"|"extern" sed 's/[^a-zA-Z0-9_]/_/g'; }
|
|
11 |
include_guard_var() { realpath "$1"|"command" sed 's/[^a-zA-Z0-9_]/_/g'; }
|
|
14 | 12 |
|
15 | 13 |
self_not_included() # usage: if self_not_included; then ... fi |
16 | 14 |
{ |
... | ... | |
153 | 151 |
|
154 | 152 |
echo_cmd() |
155 | 153 |
{ |
156 |
case "$1" in extern) shift;; esac # extern implied by the log_level
|
|
154 |
case "$1" in command) shift;; esac # command implied by the log_level
|
|
157 | 155 |
log "$*" |
158 | 156 |
} |
159 | 157 |
|
... | ... | |
177 | 175 |
for cmd in rm; do alias "$cmd=echo_run $cmd"; done; unset cmd |
178 | 176 |
|
179 | 177 |
# echo all external commands |
180 |
alias extern="echo_run extern " # last space alias-expands next word
|
|
178 |
alias command="echo_run command " # last space alias-expands next word
|
|
181 | 179 |
|
182 |
alias self='extern "$FUNCNAME"' # usage: wrapper() { self ...; }
|
|
180 |
alias self='command "$FUNCNAME"' # usage: wrapper() { self ...; }
|
|
183 | 181 |
|
184 | 182 |
# commands that are always external |
185 |
for cmd in env; do alias "$cmd=extern $cmd"; done; unset cmd
|
|
183 |
for cmd in env; do alias "$cmd=command $cmd"; done; unset cmd
|
|
186 | 184 |
|
187 | 185 |
function echo_func() |
188 | 186 |
{ |
lib/sh/db.sh | ||
---|---|---|
37 | 37 |
if test "$schema"; then local database="${database-$schema}"; fi |
38 | 38 |
|
39 | 39 |
local var=ssh_dest; local_inv |
40 |
extern ${ssh_dest:+ssh "$ssh_dest" }"${FUNCNAME[1]}" \
|
|
40 |
command ${ssh_dest:+ssh "$ssh_dest" }"${FUNCNAME[1]}" \
|
|
41 | 41 |
${server:+ --host="$server" }${user:+--user="$user" } --password\ |
42 | 42 |
${password+="$password"} ${database:+--databases "$database" --tables } "$@" |
43 | 43 |
} |
Also available in: Unified diff
*{.sh,run}: replaced extern with command, a shell builtin that does the same thing. this is also part of dash (the Bourne shell on Linux).