Trivia question - Does bash write to .bash_history any time other than on exit? If so, when?
4
4
@hal_pomeranz Any time the process gets a signal other than SIGABRT?
1
@chaumurky I haven't tested that. But assuming the signal doesn't cause the shell to exit, I'm willing to bet not.
1
@hal_pomeranz some old bash source gave me the idea..: "if (interactive_shell && sig != SIGABRT) maybe_save_shell_history ();"
3
1
1
Replying to @chaumurky
@chaumurky HUP, TERM exits shell and writes history. KILL/ABRT/USR[12]/TRAP kill shell w/o writing history. INT/QUIT leave shell, no write.

Apr 5, 2016 · 2:22 PM UTC

1