[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: workaround to not overwrite .bash_history

From: Software Groups
Subject: Re: workaround to not overwrite .bash_history
Date: Mon, 10 Jul 2006 18:15:41 -0400

Hi all,

I use BASH shell for my work. I have following setting to store BASH
history to file; this works Solaris 10 with bash 3.0. But with Fedora
Linux 5 with bash 3.1 its not working

I type command on one screen window (window number 1).  Then I can
switch to another screen windows (window number 2). Using up arrow key
I can get the same command.

Solairs it appends commands immediately (using tail I am watching the
file). Linux it's not appending to history file.

Any Idea why it's not working on Linux?

BASH_VERSINFO=([0]="3" [1]="1" [2]="7" [3]="1" [4]="release"
HISTIGNORE='&:ls:ls *:clear:[bf]g:exit:du|who'
PROMPT_COMMAND='shrhist; echo -ne "\033k`uname -n`\033\134" '

   shrhist ()
   history -a $HISTFILE;
   history -n $HISTFILE


On 6/14/06, cga2000 <address@hidden> wrote:
On Tue, Jun 13, 2006 at 06:52:57PM EDT, Aaron Griffin wrote:
> You might be able to get by with something like:
> export PROMPT_COMMAND="history -a $HISTFILE"
this appends the current session's history list to the history file.
Since the OP wants to share the history across sessions I assume this
includes sessions that are already running?

In that case he would also need to do a "history -n".

I don't know if the PROMPT_COMMAND supports more than one command - and
it's a bit late to test. :-)

But he could probably define a bash function something like:

shrhist ()
       history -a $HISTFILE
       history -n $HISTFILE

.. thus keeping his history lists & history file in sync' ..?


> _______________________________________________
> screen-users mailing list
> address@hidden

screen-users mailing list

Software Groups (SFG)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]