Project

General

Profile

« Previous | Next » 

Revision 9081

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

View differences:

util.sh
78 78

  
79 79
#### strings
80 80

  
81
repeat() # usage: str=... n=... repeat
82
{
83
	: "${str?}" "${n:?}"; local n="$n" # will be modified in function
84
	for (( ; n > 0; n-- )); do printf '%q' "$str"; done
85
}
86

  
81 87
sed_ere_flag="$(test "$(uname)" = Darwin && echo E || echo r)"
82 88

  
83 89
sed() { self -"$sed_ere_flag" "$@";}

Also available in: Unified diff