MSR: Use `sh` compatible code to remove last char
@@ -95,11 +95,11 @@ translate()
then
[ -n "$COMMAND" ] && writeBlock "$TMPFILE"
COMMAND=$(printf '%s' "$line" | grep -Eo '[^ \t].*')
- [ "${line: -1}" == '\' ] && COMMAND="${COMMAND%?}"
+ [ "${line: -1}" == '\' ] && COMMAND=$(printf '%s' "$COMMAND" | sed 's/.$//')
while [ "${line: -1}" == '\' ];
do
read -r line
- if [ "${line: -1}" == '\' ]; then COMMAND=$(printf '%s\n%s' "$COMMAND" "${line%?}")
+ if [ "${line: -1}" == '\' ]; then COMMAND=$(printf '%s\n%s' "$COMMAND" `printf '%s' "$line" | sed 's/.$//'`)
else COMMAND=$(printf '%s\n%s\n' "$COMMAND" "$line")
fi
done
