Skip to content

Instantly share code, notes, and snippets.

@sathlan
Created April 24, 2018 09:26
Show Gist options
  • Save sathlan/1df644ce6312555c0921b51686342c0f to your computer and use it in GitHub Desktop.
Save sathlan/1df644ce6312555c0921b51686342c0f to your computer and use it in GitHub Desktop.
grep 'RESP BODY:' toto.txt | sed -e 's/RESP BODY: *//' | jq '.output | select(. != "{}")' | grep -v '^null$' |jq '. | fromjson | .output' | awk 'BEGIN{end=0};{if(end == 0){print $0}}/^}$/{end=1}'> run0
jq '.stdout' -r run0 > run0.out
grep 'RESP BODY:' toto.txt | sed -e 's/RESP BODY: *//' | jq '.output | select(. != "{}")' | grep -v '^null$' |jq '. | fromjson | .output' | awk 'BEGIN{end=0};{if(end == 1){print $0}}/^}$/{end=1}'> run1
jq '.stdout' -r run1 > run1.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment