#!/bin/bash # str - bash script string support str_endswith() { [ "${1%$2}" != "$1" ]; } str_startswith() { [ "${1#$2}" != "$1" ]; }