I'd like to prevent commands that are already present in
.bash_history on macOS from being added again if reentered in Terminal (usually by typing the first few characters and scanning back in history).
export HISTCONTROL=erasedups: ignoreboth
But what I get is a single entry for each session rather than across sessions: i.e., if a command is already in
.bash_history at the start of a session, and it's typed again, it will be added to history (though only once for that session). How do I ensure that a command that's already in `.bash_history when I launch Terminal isn't added if it's entered again?