Use += when concatenating strings

This commit is contained in:
Gerhard Hoffmann 2022-06-06 18:59:31 +02:00
parent d6131e04e9
commit e2fc368371

View File

@ -1,4 +1,4 @@
#!/bin/bash
#! /bin/bash -
# set -x
source ./log_helpers
@ -34,12 +34,13 @@ if [ "${general_utils_sourced:-1}" = "1" ]; then # include only once
local ps_pid=$! # remember pid of process substitution
local __result=""
while read __tmp <&$fd; do
if ! [ -z "$__tmp" ]; then
__result="${__result}$__tmp"
__result+=" $__tmp"
fi
done
exec {fd}>&- # close fd (i.e. process substitution)
wait $ps_pid # wait for the subshell to finish
@ -49,6 +50,7 @@ if [ "${general_utils_sourced:-1}" = "1" ]; then # include only once
printf '%s' "$__result"
return $__result_code
}
# exec_process_substitution 'opkg --noaction list'
usage () {
echo "Usage: $PROGRAM [--file config] [--?] [--help] [--version] [--dbg]"