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: NonePriority: 3 - Low
Status: DonePrivacy: Public
Assigned to: NoneOpen/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


or, in bash-4.3,


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;

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
  • -unavailable- added by chet (Posted a comment)
  • -unavailable- added by crq (Submitted the item)
  • -unavailable- added by crq

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 04 May 2015 02:01:54 PM UTCchetStatusNone=>Done
    Fri 18 Nov 2011 11:28:54 PM UTCcrqAttached File-=>Added bash-4.2-unlimited-history.patch, #24396
      Carbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1