bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "unset HISTFILESIZE" not working in .bashrc


From: Chet Ramey
Subject: Re: "unset HISTFILESIZE" not working in .bashrc
Date: Sun, 15 Feb 2009 22:12:05 -0500
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)

perryh@pluto.rain.com wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i386
> OS: freebsd6.1
> Compiler: cc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
> -DCONF_OSTYPE='freebsd6.1' -DCONF_MACHTYPE='i386-portbld-freebsd6.1' 
> -DCONF_VENDOR='portbld' -DLOCALEDIR='/usr/local/share/locale' 
> -DPACKAGE='bash' -DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  
> -I/usr/local/include -O2 -fno-strict-aliasing -pipe
> uname output: FreeBSD fbsd61 6.1-RELEASE FreeBSD 6.1-RELEASE #30: Mon Jan  1 
> 23:01:34 PST 2007     perryh@fbsd61:/usr/src/sys/i386/compile/GENERIC  i386
> Machine Type: i386-portbld-freebsd6.1
> 
> Bash Version: 3.1
> Patch Level: 10
> Release Status: release
> 
> Description:
> 
> I'm not sure whether this is a bug, or something that I don't
> understand.
> 
> I added these lines to ~/.bashrc:
> 
> echo this is .bashrc
> unset HISTFILESIZE
> 
> and started a new xterm.  It did report "this is .bashrc" before
> giving the first prompt, so I know that it did read the new
> ~/.bashrc, but it seems that either the "unset HISTFILESIZE" was
> ignored or something set it to the default value after ~/.bashrc
> had been read.  I then entered ". .bashrc" so that .bashrc would
> be read again, and this time the unset worked as expected.
> 
> Should I be using some other method to unset HISTFILESIZE?

HISTFILESIZE doesn't exist until bash tries to load the history list
from the history file (taken from $HISTFILE).  At that point, if it
doesn't have a value, it's set to $HISTSIZE.  That doesn't happen
until after the startup files are read, as you guessed.

If you want to avoid history file truncation, your best bet is to
set HISTFILESIZE to some very large value.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]