🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4022

Re: bash history: saving to and restoring from different file

#4022
From: S P Arif Sahari Wibowo
Date: Sat, 20 Sep 2008 15:01
39 lines
2328 bytes
On Sat, 20 Sep 2008, jellybean stonerfish wrote:
> From man bash

Thanks. Unfortunately the man page does not give the exact 
moment in a bash session the history is restored from or saved 
to the file. Can be quite helpful information.

> js@blackbox:~$ HISTFILE=/home/js/filename
> js@blackbox:~$ echo $HISTFILE
> /home/js/filename
> js@blackbox:~$ exit

Right. But this is manual intervention. I guess I need to 
clarify that my question is how to do it automatically, i.e. 
just seconds after the history is restored from $HISTFILE 
pointing the file A, $HISTFILE should automatically change to 
file B.

> HISTFILE=filename
> to you .bash_logout

Thanks. But there are 2 issues with this approach:

- Will the history saving happen before or after .bash_logout 
executed?

- That does not help when I use "history -a" in my shell, which 
I do sometime and I am planning to do more often (automated).


Any other idea?

Thanks!

-- 
                              (stephan paul) Arif Sahari Wibowo
    _____  _____  _____  _____
   /____  /____/ /____/ /____
  _____/ /      /    / _____/      http://www.arifsaha.com/
Technical Details
Message-ID: <alpine.OSX.1.10.0809201050320.13605@imac2006.local>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!ecngs!feeder2.ecngs.de!87.106.137.111.MISMATCH!newsfeeder.dynfx.net!weretis.net!feed.cnntp.org!news.cnntp.org!not-for-mail
References: <alpine.OSX.1.10.0809191320370.13605@imac2006.local> <O72Bk.808$as4.535@nlpi069.nbdc.sbc.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1012a6,6f426515059a57b0
X-Google-Thread: 1054c0,6f426515059a57b0
X-Google-Attributes: gid1012a6,gid1054c0,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!ecngs!feeder2.ecngs.de!87.106.137.111.MISMATCH!newsfeeder.dynfx.net!weretis.net!feed.cnntp.org!news.cnntp.org!not-for-mail
Newsgroups: comp.unix.shell,gnu.bash
Date: Sat, 20 Sep 2008 11:01:09 -0400
From: S P Arif Sahari Wibowo <arifsaha@yahoo.com>
Subject: Re: bash history: saving to and restoring from different file
In-Reply-To: <O72Bk.808$as4.535@nlpi069.nbdc.sbc.com>
Message-ID: <alpine.OSX.1.10.0809201050320.13605@imac2006.local>
References: <alpine.OSX.1.10.0809191320370.13605@imac2006.local> <O72Bk.808$as4.535@nlpi069.nbdc.sbc.com>
User-Agent: Alpine 1.10 (OSX 962 2008-03-14)
X-Archive: encrypt
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
Lines: 39
Organization: CNNTP
NNTP-Posting-Host: 68546602.read.cnntp.org
X-Trace: DXC=CZfh:bMVgP3=mB8CdLCfg3WoT\PAgXa?1NdYcLc48:A6BQ=;T6O1ba5Z]dged6hbF<WCL;1A^C63<@_\_AM@BNb<
X-Complaints-To: abuse@cnntp.org