Project

General

Profile

« Previous | Next » 

Revision 14720

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

View differences:

util.sh
160 160

  
161 161
ends_with() { test "${2%$1}" != "$2"; } # usage: ends_with pattern str
162 162

  
163
matches() { test -z "${2##$1}"; } # usage: matches pattern str
164

  
163 165
match_prefix() # usage: match_prefix pattern str
164 166
{ if starts_with "$1" "$2"; then echo "${2%${2#$1}}"; fi }
165 167

  

Also available in: Unified diff