diff --git a/lib/utils.sh b/lib/utils.sh index 236ba51..cba8a46 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -366,6 +366,13 @@ function _omb_util_add_prompt_command { } ## @fn _omb_util_split array str [sep] +## Split STR with SEP in a safe way and store the result in ARRAY. +## @param[out] array +## The name of an array variable to which the split result is stored. +## @param[in] str +## The string to split +## @param[in,opt] +## The set of separator characters. The default is ' '. function _omb_util_split { local __set=$- IFS=${3:-$' \t\n'} set -f @@ -374,6 +381,13 @@ function _omb_util_split { return 0 } +## @fn _omb_util_glob_expand array glob +## Perform the pathname expansion of a glob pattern GLOB in a safe way and +## store the filenames in ARRAY. +## @param[out] array +## The name of an array variable to which the filenames are stored. +## @param[in] glob +## The glob pattern that is attempted to match filenames function _omb_util_glob_expand { local __set=$- __shopt __gignore=$GLOBIGNORE _omb_util_get_shopt failglob nullglob extglob