Re: Common History across Shell
- From: BartlebyScrivener <bscrivener42@xxxxxxxxx>
- Date: Tue, 10 Jul 2007 16:24:29 -0000
On Jul 10, 3:36 am, quarkLore <agarwal.prat...@xxxxxxxxx> wrote:
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?
Try this in .bashrc. Note the history of your session won't be
appended to the history file until you exit the session.
# make Bash append rather than overwrite the history on disk:
shopt -s histappend
When the shell starts up, the history is initialized from the file
named by the HISTFILE variable (default `~/.bash_history'). The file
named by the value of HISTFILE is truncated, if necessary, to contain
no more than the number of lines specified by the value of the
HISTFILESIZE variable. When an interactive shell exits, the last
$HISTSIZE lines are copied from the history list to the file named by
$HISTFILE. If the histappend shell option is set (see section 4.2 Bash
Builtin Commands), the lines are appended to the history file,
otherwise the history file is overwritten. If HISTFILE is unset, or if
the history file is unwritable, the history is not saved. After saving
the history, the history file is truncated to contain no more than
$HISTFILESIZE lines. If HISTFILESIZE is not set, no truncation is
performed.
HTH
rd
.
- Follow-Ups:
- Re: Common History across Shell
- From: quarkLore
- Re: Common History across Shell
- References:
- Common History across Shell
- From: quarkLore
- Common History across Shell
- Prev by Date: tar extract write error
- Next by Date: next to the last arg
- Previous by thread: Re: Common History across Shell
- Next by thread: Re: Common History across Shell
- Index(es):
Relevant Pages
|