Skip to content

Instantly share code, notes, and snippets.

@msmarcal
Last active July 7, 2016 13:57
Show Gist options
  • Save msmarcal/fcde32d51f31b846e7264b299a96ad8e to your computer and use it in GitHub Desktop.
Save msmarcal/fcde32d51f31b846e7264b299a96ad8e to your computer and use it in GitHub Desktop.
PASSWD=<YOUR PASSWORD>
NEW_FILENAME="$(echo $1 | sed -E 's/Fatura_([0-9]{2})([0-9]{4}).*/\2-\1-VISA.pdf/')"
qpdf --decrypt --password=$PASSWD "$1" "$NEW_FILENAME"
/opt/local/bin/tag -a "topay" "$NEW_FILENAME"
rm -rf "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment