Any Bash features you'd like to see?

Chris F.A. Johnson cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org
Wed May 11 20:55:10 UTC 2005


On Wed, 11 May 2005, Peter wrote:
> On Wed, 11 May 2005, David Thornton wrote:
>
>>  who typed what , when ( and where).
>
> Oh, that's a good one. One thing that I would really like is to have 
> ..bash_history log commands from *all* open shells for a given user. I often 
> have 4-8 shells open and the history does not reflect what I was doing in all 
> of them. The easiest way would be for bash to stat and count the links to 
> bash_history on startup. If >1 open another bash_history and write to it 
> instead.

    In .bashrc, put:

PROMPT_COMMAND='history -a' ## All shells will write to the default file

    Or:

HISTFILE=$HOME/.bash_history.$$   ## New file for each shell

    There are many possible variations on this theme.

-- 
     Chris F.A. Johnson                     <http://cfaj.freeshell.org>
     ==================================================================
     Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
     <http://www.torfree.net/~chris/books/ssr.html>
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list