Project

General

Profile

« Previous | Next » 

Revision 12813

lib/sh/util.sh: added split_lines()

View differences:

trunk/lib/sh/util.sh
352 352
	starts_with 'declare -a' "$decl" # also matches -ax
353 353
}
354 354

  
355

  
356
#### text
357

  
358
fi # load new aliases
359
if self_being_included; then
360

  
361
nl='
362
'
363

  
364
# usage: split_lines str; use ${lines[@]}
365
function split_lines() { echo_func; split "$nl" "$1"; lines=("${parts[@]}"); }
366
alias split_lines='declare lines; "split_lines"'
367

  
368

  
355 369
#### paths
356 370

  
357 371
strip/() { echo "${1%/}"; } # strips trailing /s

Also available in: Unified diff