Project

General

Profile

« Previous | Next » 

Revision 12953

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

View differences:

util.sh
299 299

  
300 300
rm_prefix() { echo "${2#$1}"; } # usage: rm_prefix pattern str
301 301

  
302
contains_match() { starts_with "*$1" "$2"; } # usage: contains_match pattern str
303

  
302 304
repeat() # usage: str=... n=... repeat
303 305
{
304 306
	: "${str?}" "${n:?}"; local result= n="$n" # n will be modified in function

Also available in: Unified diff