Revision 12707
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
338 | 338 |
wildcard/() # usage: array=($([clog++ cd ...;] wildcard/ unquoted_pattern...)) |
339 | 339 |
{ cmd=strip/ foreach_arg; esc_args "$@"; } |
340 | 340 |
|
341 |
wildcard.() # usage: array=($([clog++ cd ...;] wildcard. unquoted_pattern...)) |
|
342 |
# currently only removes . .. at beginning of list |
|
343 |
{ |
|
344 |
set -- $(wildcard/ "$@") # first strip trailing /s |
|
345 |
local to_rm=(. ..) |
|
346 |
local item |
|
347 |
if contains "$1" "${to_rm[@]}"; then |
|
348 |
shift |
|
349 |
if contains "$1" "${to_rm[@]}"; then shift; fi |
|
350 |
fi |
|
351 |
esc_args "$@" |
|
352 |
} |
|
353 |
|
|
341 | 354 |
#### streams |
342 | 355 |
|
343 | 356 |
pipe_delay() # usage: cmd1 | { pipe_delay; cmd2; } |
Also available in: Unified diff
lib/sh/util.sh: added wildcard.()