On 11/6/14, 5:19 AM, Piotr Grzybowski wrote: > On Thu, Nov 6, 2014 at 3:28 AM, Chet Ramey <chet.ra...@case.edu> wrote: >> >> In theory, one could change the functions in history.c and histfile.c to >> change the in-memory history list to one that uses a file, possibly with >> mmap(). >> I'd be happy to look at contributed code to do this [..] > > would you accept a solution like this: > > 1. all running instances of bash with history support on, share > history via shmem segment (some care as to its size should be taken) > 2. $HISTFILE in every bash points to history file where every bash > writes history in chronological (depending on settings) order
You could use mmap, but the synchronization between different shells writing to the same mmaped segment is a problem that has to be solved. > 3. $HISTFILE is only read on startup, if there are no other bash > instances running > 4. sharing of history and synchronisation between instances is > realised via standard ipc There is no "standard ipc" except pipes across the range of systems bash runs on. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/