Created
March 18, 2016 16:21
-
-
Save orangecms/2ec614b4eac564cda5d8 to your computer and use it in GitHub Desktop.
Simply read a gpg-encrypted file in less
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 | |
# if $1 is set, source the corresponding file | |
if [ -n "$1" ] | |
then | |
if [ -f "$1" ] | |
then | |
gpg --decrypt $1 2> /dev/null | less | |
else | |
echo "File does not exist." | |
fi | |
else | |
echo "No file given to source." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment