Project

General

Profile

« Previous | Next » 

Revision 12952

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

View differences:

trunk/lib/sh/util.sh
292 292

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

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

  
295 297
match_prefix() # usage: match_prefix pattern str
296 298
{ if starts_with "$1" "$2"; then echo "${2%${2#$1}}"; fi }
297 299

  

Also available in: Unified diff