commit 74fccb9be668d5b1c0eaffede9bce01b0e3e11ee
parent b35644413ce6eeb472d098aed6c18315eba32e62
Author: finwo <finwo@pm.me>
Date: Thu, 12 Aug 2021 23:20:09 +0200
Whitespace fixes in tools
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tool/ini.sh b/tool/ini.sh
@@ -42,7 +42,7 @@ while read line; do
# Output found variable
NAME=${line%%=*}
NAME=${NAME%%*( )}
- VALUE=${line##*=}
+ VALUE=${line#*=}
VALUE=${VALUE##*( )}
# Output searched or all
diff --git a/tool/template.sh b/tool/template.sh
@@ -45,7 +45,9 @@ while [ "$#" -gt 0 ]; do
shift
PARTIALARGS="${PARTIALARGS} -c ${1}"
if [[ -f "${1}" ]]; then
- while IFS='=' read key value; do
+ while IFS='\n' read line; do
+ key=${line%%=*}
+ value=${line#*=}
if [ -z "$key" ]; then continue; fi
TOKENS["$key"]="$value"
done <<< "$(${DIR}/ini.sh ${1})"
@@ -95,7 +97,7 @@ for templatefile in "${TEMPLATES[@]}"; do
done
# Output the result
- echo -e "$CONTENT"
+ echo -e "${CONTENT//"\\"/"\\\\"}"
done