Basically does a cat $HOME/.bash_history | sort | uniq > .bash_history.go_history
, but preserves order. If you know what I mean.
go get github.com/adamryman/go_history
# To replace $HOME/.bash_history with all leading dupicates removed
go_history -r
# Avoid duplicates
export HISTCONTROL=erasedups
export PROMPT_COMMAND="history -a"
if which go_history >/dev/null; then
export PROMPT_COMMAND="history -a;go_history -r"
fi