Skip to content

Instantly share code, notes, and snippets.

@orangecms
Created March 18, 2016 16:21
Show Gist options
  • Save orangecms/2ec614b4eac564cda5d8 to your computer and use it in GitHub Desktop.
Save orangecms/2ec614b4eac564cda5d8 to your computer and use it in GitHub Desktop.
Simply read a gpg-encrypted file in less
#!/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