diff --git a/general_utils b/general_utils index ae39f21..2cc0133 100755 --- a/general_utils +++ b/general_utils @@ -6,6 +6,24 @@ source ./log_helpers if [ "${general_utils_sourced:-1}" = "1" ]; then # include only once readonly general_utils_sourced=${BASH_SOURCE[0]} + # compare two strings + equal () { + case "$1" in + "$2") + return 0 + ;; + esac + return 1 # they don't match + } + + # check if second string is contained in first string + contains () { + if grep -qE "$2" <<< $1; then + return 0 + fi + return 1 # not contained + } + exec_process_substitution () { local func="${FUNCNAME[0]}" log_debug "$func:${LINENO} exec-ing [$*]"