How can I make sure that my bash history gets written to
~/.bash_history when I am disconnected abnormally?
I work on several remote Linux hosts, and my connection is frequently terminated abnormally. When that happens, my recent bash history is not available when I reconnect. I suspect that the abnormal termination is preventing the bash shell from writing to
~/.bash_history. I can’t control the disconnects, and other than losing my history, the abnormal disconnects don’t cause a problem.
I don’t want to interfere with the normal history mechanism. In other words, I don’t want a hack that messes up the history process. Thanks!