Created
May 16, 2021 01:56
-
-
Save alecbw/dd1351be0c7fe906ec6ef6dacffcf42f to your computer and use it in GitHub Desktop.
A quick oneliner you can add to your .bash_profile to pretty print the contents of your clipboard.
This file contains hidden or 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
| # Takes the contents of the clipboard, replaces apostrophes (') with quotation marks (") and replaces titlecased bools (True/False) with JSON acceptable lowercase, then pretty prints | |
| function pjson() { | |
| pbpaste | sed "s/'/\"/g" | sed "s/True/true/g" | sed "s/False/false/g" | json_pp | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment