Re: Common History across Shell
- From: quarkLore <agarwal.prateek@xxxxxxxxx>
- Date: Wed, 11 Jul 2007 03:27:03 -0700
# 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
What you are describing is a little different. This will append
history in file from each session *after* the particular session
exits. What I wanted was multiple sessions can share history (the
history maintained in RAM and not file) amongst themselves during
active session.
The need is that a user who has two or more sessions open and he has
typed some extremely long command in one of them. It becomes a pain to
retype on other shell session. So on a keystroke he may want to merge
all the histories without exiting the second session.
What frank has told for zsh is what I want for bash
.
- Follow-Ups:
- Re: Common History across Shell
- From: BartlebyScrivener
- Re: Common History across Shell
- References:
- Common History across Shell
- From: quarkLore
- Re: Common History across Shell
- From: BartlebyScrivener
- Common History across Shell
- Prev by Date: Re: read with initialized value (bash)
- Next by Date: Re: 'source' not executing executables
- Previous by thread: Re: Common History across Shell
- Next by thread: Re: Common History across Shell
- Index(es):
Relevant Pages
|