With echo $ echo -n "<gpg string>" | gpg --decrypt With tee $ tee <<EOM | gpg -d <gpg message string> EOM