Randall wrote regarding 'Re: [SLE] BASH History' on Wed, Sep 01 at 17:27: [...]
If you want to solve that problem, the one possible "reliable" solution is to make the history file a named pipe, and run a daemon that manages sorting duplicates, etc. That wouldn't be *too* hard to write, but would be a pain none the less.
I can see how the saving could be done, but how would restoring work? BASH wants to read from that "file" (really a named pipe) now, and two readers of a named pipe just hang waiting for a writer.
I was just presuming that the shell obtained an exclusive lock on the history file for readnig - which would be relatively important in the case where one shell's exiting and overwriting the history at the same time another shell is starting. Admittedly, I didn't look into that... Doing a little testing, I guess multiple readers from a named pipe is not a good idea. :) You could still do the one-pipe-per-shell thing with the environment variable, though. Wait, that'd be awful. If you do that, don't let anyone know that I suggested it. I need to wash my keyboard after such a suggestion. --Danny