Created
August 29, 2013 20:11
-
-
Save AaronJackson/6382832 to your computer and use it in GitHub Desktop.
Quick and messy bash script for viewing plain text files encrypted with GPG
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/bash | |
GPG_ID=`gpg --list-secret-keys | grep "sec " | awk '{ print $2 }' | awk -F '/' '{ print $2 }'` | |
DATA=`cat $1 | gpg -d -r $GPG_ID` | |
clear | |
printf '%*s\n\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - | |
echo "$DATA" | |
unset DATA | |
printf '\n\n%*s\n\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - | |
echo "Press any key to clear this screen" | |
read -n 1 -s | |
clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment