patchThe GNU Bourne-Again SHell - Patches: patch #7669, to make the .bash_history save...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #7669: to make the .bash_history save unlimited entries, no duplicates, save for ever

Submitted by:  CHENG Renquan <crq>
Submitted on:  Fri 18 Nov 2011 11:28:54 PM UTC  
 
Category:  None Priority:  3 - Low
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Open

Tue 22 Nov 2011 02:10:56 AM UTC, comment #3:

Thanks for the comment. You're correct, unsetting HISTFILESIZE in a startup file will result in bash setting it to a default value. Those who want unlimited history file sizes, which is not everyone, can use something like

HISTFILESIZE=
HISTFILESIZE=notrunc

or, in bash-4.3,

HISTFILESIZE=-1

in a startup file to effect it.

This isn't a good enough reason to change incompatibly.

Chet Ramey <chet>
Project Administrator
Tue 22 Nov 2011 01:59:22 AM UTC, comment #2:

Even though the current bash(1) manual said "If HISTFILESIZE is not set, no truncation is performed", there is no way to leave HISTFILESIZE unset automatically, I mean by .bashrc or other rc files; because even if bashrc unset HISTFILESIZE explictly, the bash binary would still set HISTFILESIZE to HISTSIZE; only when the user issue "unset HISTFILESIZE" in interactive mode, it could take effect, that's not convenient;

HISTORY
[...]
contain no more than HISTFILESIZE lines. If HISTFILESIZE is not set, no truncation is performed.

CHENG Renquan <crq>
Tue 22 Nov 2011 01:18:34 AM UTC, comment #1:

Thanks for the patch. Your change to avoid setting HISTFILESIZE, while maybe desirable, is not backwards compatible. I prefer to use and better document the existing mechanism -- set HISTFILESIZE to an empty or non-numeric value -- and add one -- set HISTFILESIZE to a value that evaluates to less than zero.

I'll look at the other part of the patch.

Chet Ramey <chet>
Project Administrator
Fri 18 Nov 2011 11:28:54 PM UTC, original submission:

Nowadays hard disk storage is cheap, but commands history is valuable, here I avoid to set HISTFILESIZE to HISTSIZE if the user choose to not set HISTFILESIZE, that means unlimited;

CHENG Renquan <crq>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by crq (Submitted the item)
  • -email is unavailable- added by crq
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-04 chet StatusNone => Done
    2011-11-18 crq Attached File- => Added bash-4.2-unlimited-history.patch, #24396
        Carbon-Copy- => Added -email is unavailable-

    Back to the top


    Powered by Savane 3.3