history-clean 295 B

1234567
  1. #!/usr/bin/env bash
  2. # This script will clean the history file of PGP messages and keys
  3. histfile="${1:-$HISTFILE:-$HOME/.histfile}"
  4. cp -a "$histfile" "/tmp/$histfile.bak"
  5. sed --in-place '/gpg/d' "$histfile"
  6. sed --in-place '/-----BEGIN PGP MESSAGE-----/,/-----END PGP MESSAGE-----/d' "$histfile"