aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%/.bash_utils
diff options
context:
space:
mode:
Diffstat (limited to '%HOME%/.bash_utils')
-rw-r--r--%HOME%/.bash_utils/text.sh26
1 files changed, 10 insertions, 16 deletions
diff --git a/%HOME%/.bash_utils/text.sh b/%HOME%/.bash_utils/text.sh
index 238eb5e..db87066 100644
--- a/%HOME%/.bash_utils/text.sh
+++ b/%HOME%/.bash_utils/text.sh
@@ -254,20 +254,14 @@ str_join() (
local delim="$1"
shift
- case "$#" in
- 0)
- ;;
- 1)
- echo "$@"
- ;;
- *)
- local s="$1"
- shift
- printf -- '%s' "$s"
-
- for s; do
- printf -- '%s%s' "$delim" "$s"
- done
- ;;
- esac
+ [ "$#" -eq 0 ] && return 0
+
+ local str="$1"
+ shift
+
+ echo -n "$str"
+ for str; do
+ echo -n "$delim$str"
+ done
+ echo
)