Behaviour for unset HISTFILESIZE in bashrc not in accordance with man page

Bug #327874 reported by Yung-Chin Oei
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Yung-Chin Oei

Bug Description

Binary package hint: bash

This is on Ubuntu 8.04.2 for amd64, with bash package version 3.2-0ubuntu18.
(but in fact the problem occurs similarly on Red Hat Enterprise Linux 5.3, for example)

According to man bash "If HISTFILESIZE is not set, no truncation is performed." In my experience however, unsetting HISTFILESIZE in ~/,bashrc results in HISTFILESIZE being given a default value of 500, and the history file is truncated accordingly.

To reproduce the bug, append the following line to ~/.bashrc:

Then, open a new terminal, and type

This will return "500".
In contrast, when we change our entry in ~/.bashrc to

when we now open a new terminal, we find HISTFILESIZE is indeed set to 0.

Summary: effectively we can't unset this value in .bashrc, and the man page suggests otherwise. Desired behaviour: leave the history untruncated if we unset HISTFILESIZE in .bashrc.

PS, for completeness: I'm also using the setting "shopt -s histappend" in .bashrc. As the man page specifies, this only results in the history being truncated on starting a new bash rather than on closing the old one.

Revision history for this message
Yung-Chin Oei (yungchin) wrote :

I'm sorry for the noise. I was just looking at various versions of the bash source, and the described behaviour has been this way at least back until version 2.05 or so, so it is not reasonable to change this. Instead, I'll try to come up with a rewording of the man page info. Assigned to me and marked invalid.

Changed in bash:
assignee: nobody → patsoe
status: New → Invalid
Revision history for this message
Johan Boule (johan-boule) wrote :

I have been hit by this too. What value can we set HISTFILESIZE not to have it truncated then ? Empty value ?

Changed in bash (Ubuntu):
status: Invalid → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.