Retaining Bash history from all sessions
I've noticed that when I have many sessions open, the history from one closed session will overwrite the history from another earlier closed session so that when I open a new session I only see the history of the most recently closed session.
Is there a way I can merge/retain all Bash history from all sessions?
I was thinking about something in the .bash_logout, perhaps a func to merge the histories, appending only the new lines to the history file, but the problem is that the history numbering overlaps, so this could be tricky.
Another question would be how Bash handles the history, is it before or after the processing of the history file? If it's after, then would bash just overwrite the history file with the current session history regardless of what is in .bash_logout?