Last active
February 12, 2016 00:49
-
-
Save KilledKenny/8e3bb63ebb8a02746c34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sed -e ':a;s/^[ \t\r\n]\+//;/^,\|^:\|^+\|^-\|^\.\|^e\|^\[\|^\]\|^}\|^{/{/^\]\|^}\|^{/{x;/[^ ]/{p;s/\( *\)\(.*\)/\1/};x};H;x;/^\n/ {s/\(.\)\(.\)\(.*\)/\2/};/^\n/ ! {s/\([^\n]*\)\(\n*\)\(.\)\(.*\)/\1\3/};s/\n//g;x;/^\]\|^}/{x;s/^ //;x};/^,\|^\[\|^\]\|^}\|^{/{x;p;s/\( *\)\(.*\)/\1/;x};/^\[\|^{/{x;s/^/ /;x};s/.//;ba};/^"/{H;x;:b;s/\([^\n]*\)\(\n\)\(.*\)\(\\"\)\(.*\)/\1\2\3\n\5/;tb;s/\([^\n]*\)\(\n\)\("[^"]*"\)\(.*\)/\1\o033[32m\3\o033[0m/;s/\n/\\"/g;x;:c;/^""/{s/""//;ba};s/^\("\)\(\\"\|.\)/\1/;tc;ba};/^[0-9]/{H;x;s/\([^\n]*\)\(\n\)\([0-9]\+\)\(.*\)/\1\o033[95m\3\o033[0m/;x;s/^[0-9]\+//;ba};/^true\|^false\|^null/{H;x;s/\([^\n]*\)\(\n\)\(true\|false\|null\+\)\(.*\)/\1\o033[96m\3\o033[0m/;x;s/^true\|^false\|^null//;ba};${p};d' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment