Re: Common History across Shell



On 2007-07-10, quarkLore wrote:
AFAIK history in bash is implemented such that each bash instance
maintains its individual history in memory. As and when a bash session
exits it updates history file.

If there are multiple shells running together then commands entered in
one can't be accessed using history command from other shells.

I am looking for a feature where if a user has multiple shells and on
a special keystroke / command all shells get a common history which is
sum of all histories.

Does such a feature exist in bash or any other shell?
Can such a feature be implemented without changing the shell's code?

PROMPT_COMMAND='history -a; history -c; history -r'

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.



Relevant Pages

  • Re: [SLE] BASH History
    ... Randall wrote regarding 'BASH History' on Sat, ... > interactive BASH shells and one root shell running. ... > history file, and I end up with only one of those shells' history. ... file named by the value of HISTFILE is truncated, ...
    (SuSE)
  • Re: [SLE] BASH History
    ... > The BASH history question reminded of a small problem I have with this ... > interactive BASH shells and one root shell running. ... > history file, and I end up with only one of those shells' history. ... Perhaps the history is only saved if you logout of each shell properly, ...
    (SuSE)
  • Re: Common History across Shell
    ... maintains its individual history in memory. ... If there are multiple shells running together then commands entered in ... one can't be accessed using history command from other shells. ... Does such a feature exist in bash or any other shell? ...
    (comp.unix.shell)
  • Re: [SLE] BASH History
    ... On Saturday 28 Aug 2004 16:07, Randall R Schulz wrote: ... > The BASH history question reminded of a small problem I have with this ... > interactive BASH shells and one root shell running. ... > history file, and I end up with only one of those shells' history. ...
    (SuSE)
  • Re: Debian equivalent of /etc/profile.d
    ... (That's because these environment variables would have to ... Slackware handles this "multiple shells" situation by sourcing ... "sh" and "csh" versions. ...
    (Debian-User)