From d0f9ebf71c143ad7276be54d85d644f614e6d391 Mon Sep 17 00:00:00 2001 From: celso Date: Thu, 23 Mar 2023 00:21:23 -0300 Subject: [PATCH] fixed newlines screwing with the viewer --- viewer.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/viewer.sh b/viewer.sh index c62ce79..2846137 100755 --- a/viewer.sh +++ b/viewer.sh @@ -15,6 +15,11 @@ view_content(){ local -n _REF="${1}" print_dashes; printf "\n" for i in "${!_REF[@]}"; do + [ "${i}" == "text" ] && { + printf "[%s] \t=\t" "${i}" + sed ':a;N;$!ba;s/\n/\\n/g' <<< "${_REF[${i}]}" + continue + } [ ! -z "${_REF[${i}]}" ] && printf "[%s] \t=\t%s\n" "${i}" "${_REF[${i}]}" done }