Project

General

Profile

« Previous | Next » 

Revision 9653

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

View differences:

lib/sh/util.sh
170 170

  
171 171
#### strings
172 172

  
173
starts_with() { test "${2#$1}" != "$2"; } # usage: starts_with pattern str
174

  
173 175
repeat() # usage: str=... n=... repeat
174 176
{
175 177
	: "${str?}" "${n:?}"; local result= n="$n" # n will be modified in function

Also available in: Unified diff