Revision 12709
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
303 | 303 |
|
304 | 304 |
echo1() { echo "$1"; } # usage: echo1 values... |
305 | 305 |
|
306 |
esc_args() # usage: array=($(prep_env... (eg. cd); esc_args args...)) |
|
306 |
esc_args() # usage: array=($(log++; prep_env... (eg. cd); esc_args args...))
|
|
307 | 307 |
{ local arg; for arg in "$@"; do printf '%q ' "$arg"; done; } |
308 | 308 |
|
309 | 309 |
# usage: split delim str; use ${parts[@]} |
... | ... | |
337 | 337 |
|
338 | 338 |
strip/() { echo "${1%/}"; } # strips trailing /s |
339 | 339 |
|
340 |
wildcard/() # usage: array=($([clog++ cd ...;] wildcard/ unquoted_pattern...))
|
|
340 |
wildcard/() # usage: array=($(log++; [cd ...;] wildcard/ unquoted_pattern...))
|
|
341 | 341 |
{ cmd=strip/ foreach_arg; esc_args "$@"; } |
342 | 342 |
|
343 |
wildcard.() # usage: array=($([clog++ cd ...;] wildcard. unquoted_pattern...))
|
|
343 |
wildcard.() # usage: array=($(log++; [cd ...;] wildcard. unquoted_pattern...))
|
|
344 | 344 |
# currently only removes . .. at beginning of list |
345 | 345 |
{ |
346 | 346 |
set -- $(wildcard/ "$@") # first strip trailing /s |
Also available in: Unified diff
fix: lib/sh/util.sh: commands run inside $(...): need to run with log++ so that these aren't normally debug-printed