bug-bash
[Top][All Lists]
Advanced

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

Re: (low priority) BUG: too large history=nohistory?


From: Chet Ramey
Subject: Re: (low priority) BUG: too large history=nohistory?
Date: Mon, 30 Jan 2012 17:20:54 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 1/30/12 4:14 PM, Linda Walsh wrote:
> It seems there is a a platform dependent bug somewhere:
> 
>> HISTSIZE=$(((3**15))
> echo $HISTSIZE
> 1000000000000000
> --- but you have no history...

It depends on how the platform does integer truncation.  Bash uses intmax_t
for its numbers internally; the readline and history libraries use ints.
On a platform where sizeof(intmax_t) == 8 and sizeof(int)==4, you'll get
truncation.  On a RHEL5 box I happen to have handy, that still means you
get a max history size of 14348907 after correcting and performing the
assignment above.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
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]