X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Ffunctions.sh;h=5771586fb47ed99143b0277aca1093da9085760b;hb=b8cb2a405ef5ff881ed7c256c57f0b06fe7615b5;hp=cbd9dbe074239fe29a0d22f9a3f2439d228582c7;hpb=6a22472524839190e6b156befd8886c81be6e550;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index cbd9dbe0..5771586f 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -743,7 +743,7 @@ return 0 } # pretty prints the json files provided as parameters. - function json_view() + function clean_json() { if [ -z "$*" ]; then return; fi local show_list=() @@ -760,6 +760,16 @@ return 0 rm "${show_list[@]}" } + function json_text() + { + # only print our special headers or text fields. + local CR=$'\r' + local LF=$'\n' + clean_json $* | + grep -i "\"text\":\|^=.*" | + sed -e "s/\\\\r/$CR/g" -e "s/\\\\n/\\$LF/g" + } + ############## # NOTE: no more function definitions are allowed after this point.