Revision 12817
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
326 | 326 |
{ local arg; for arg in "$@"; do printf '%q ' "$arg"; done; } |
327 | 327 |
|
328 | 328 |
# usage: split delim str; use ${parts[@]} |
329 |
function split() { echo_func; local IFS="$1"; parts=($2); echo_vars parts; } |
|
329 |
function split() { local IFS="$1"; parts=($2); echo_vars parts; } |
|
330 |
# no echo_func because used by log++ |
|
330 | 331 |
alias split='declare parts; "split"' |
331 | 332 |
|
332 | 333 |
join() { local IFS="$delim"; echo "$*"; } # usage: delim=char join elems... |
... | ... | |
362 | 363 |
' |
363 | 364 |
|
364 | 365 |
# usage: split_lines str; use ${lines[@]} |
365 |
function split_lines() { echo_func; split "$nl" "$1"; lines=("${parts[@]}"); } |
|
366 |
function split_lines() { split "$nl" "$1"; lines=("${parts[@]}"); } |
|
367 |
# no echo_func because used by log++ |
|
366 | 368 |
alias split_lines='declare lines; "split_lines"' |
367 | 369 |
|
368 | 370 |
|
Also available in: Unified diff
bugfix: lib/sh/util.sh: removed echo_func in functions used by log++, to avoid spurious highlighted output