Use += when concatenating strings
This commit is contained in:
parent
d6131e04e9
commit
e2fc368371
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#! /bin/bash -
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
source ./log_helpers
|
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 ps_pid=$! # remember pid of process substitution
|
||||||
|
|
||||||
local __result=""
|
local __result=""
|
||||||
|
|
||||||
while read __tmp <&$fd; do
|
while read __tmp <&$fd; do
|
||||||
if ! [ -z "$__tmp" ]; then
|
if ! [ -z "$__tmp" ]; then
|
||||||
__result="${__result}$__tmp"
|
__result+=" $__tmp"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exec {fd}>&- # close fd (i.e. process substitution)
|
exec {fd}>&- # close fd (i.e. process substitution)
|
||||||
wait $ps_pid # wait for the subshell to finish
|
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"
|
printf '%s' "$__result"
|
||||||
return $__result_code
|
return $__result_code
|
||||||
}
|
}
|
||||||
|
# exec_process_substitution 'opkg --noaction list'
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
echo "Usage: $PROGRAM [--file config] [--?] [--help] [--version] [--dbg]"
|
echo "Usage: $PROGRAM [--file config] [--?] [--help] [--version] [--dbg]"
|
||||||
|
Loading…
Reference in New Issue
Block a user