projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean_json and json_text are working
[feisty_meow.git]
/
scripts
/
core
/
functions.sh
diff --git
a/scripts/core/functions.sh
b/scripts/core/functions.sh
index cbd9dbe074239fe29a0d22f9a3f2439d228582c7..5771586fb47ed99143b0277aca1093da9085760b 100644
(file)
--- a/
scripts/core/functions.sh
+++ b/
scripts/core/functions.sh
@@
-743,7
+743,7
@@
return 0
}
# pretty prints the json files provided as parameters.
}
# pretty prints the json files provided as parameters.
- function
json_view
()
+ function
clean_json
()
{
if [ -z "$*" ]; then return; fi
local show_list=()
{
if [ -z "$*" ]; then return; fi
local show_list=()
@@
-760,6
+760,16
@@
return 0
rm "${show_list[@]}"
}
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.
##############
# NOTE: no more function definitions are allowed after this point.