diff --git a/bashopts.sh b/bashopts.sh index e1046124b535a5eac139e44b731000f26296e829..d8891ed316d744ecd1776afdaf18399087cca280 100644 --- a/bashopts.sh +++ b/bashopts.sh @@ -387,9 +387,12 @@ bashopts_math_min() { # join array element bashopts_join_by() { - local IFS="$1" - shift || bashopts_log C "Usage: bashopts_join_by [elt1 [elt2...]]" - echo "$*" + local sep="$1" + shift || bashopts_log C "Usage: bashopts_join_by [elt1 [elt2...]]" + printf "%s" "$1" + test $# -gt 1 || return 0 + shift + printf "$sep%s" "$@" } # dump an option value by its name