Created
February 8, 2019 17:26
-
-
Save maksadbek/a07a4063b9e259e697ba5503da3ea665 to your computer and use it in GitHub Desktop.
Pretty print json from clipboard and open in vim
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
#!/bin/bash | |
randname=$(LC_ALL=C cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 5 | head -n 1) | |
randname="$(date "+%d_%m_%y_")$randname" | |
randfile="/tmp/$randname" | |
echo $randname | |
pbpaste | jq . > $randfile && vim $randfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment