Skip to content

Instantly share code, notes, and snippets.

@synsa
Forked from jjarmoc/gist:1571540
Created August 20, 2018 17:20
Show Gist options
  • Save synsa/7b6a0dfd8cc13c60ee59df5771710fd4 to your computer and use it in GitHub Desktop.
Save synsa/7b6a0dfd8cc13c60ee59df5771710fd4 to your computer and use it in GitHub Desktop.
Quoted Printable encode/decode bash aliases - suitable for pipelining
# To decode:
# qp -d string
# To encode:
# qp string
alias qpd='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::decode($_);'\'''
alias qpe='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::encode($_);'\'''
function qp {
if [[ "$1" = "-d" ]]
then
echo ${@:2} | qpd
else
echo ${@} | qpe
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment