#!/bin/bash
# does what it says on the tin.
# also deletes revoked keys
# https://superuser.com/a/1631427
gpg --list-keys --with-colons \
    | awk -F: '$1 == "pub" && ($2 == "r" || $2 == "e") { print $5 }' \
    | xargs gpg --batch --yes --delete-keys
