history-clean 292 B

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