-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Jan 28, 2008 at 11:32:00PM +0000, Jason McIntyre sez: > On Sun, Jan 27, 2008 at 05:27:26PM -0600, Denny White wrote: > > > > I've read the ksh man page, googled for days, & can't seem to come > > up with the answer. Either I put no mention of HISTFILE and HISTSIZE > > in $HOME/.profile and I don't have a lasting history file of previous > > commands. Or, I put it in and I do have a history file, but the > > HISTSIZE setting has no effect. It doesn't change and the file grows > > and grows. Currently I have it set as shown below to save my command > > line history: > > > > HISTFILE=.ksh_history > > HISTSIZE="50" > > > > I've tried using .ksh_history$$ to have a different file each login, > > and know I can run a cronjob nightly to clean them up if I want to, > > but I can't figure out how to make the history turn over just like > > it's supposed to with the HISTSIZE value without all that other mess. > > Thanks for any help I can get on this. > > > > notice that the variable is named "HISTSIZE", not "HISTFILESIZE" :) > > HISTSIZE affects how many commands are kept in history (in memory - not > file). so, for example, if you set HISTSIZE=3 you'll only be able to > recall the past 3 commands in history. it does not turn over HISTFILE, > however. > > i'm a bit confused by this myself, though - it does seem logical that > the HISTFILE not store more commands than history itself is able to > recall. i can;t tell by looking at the code what goes on in there - > maybe someone else can chip in... > > jmc >
Thanks, Jason. Yeah, I tried the HISTFILESIZE too. What's really weird is, just all of a sudden, it started working! But, instead of it starting with the number 1 on the beginning, with HISTSIZE set at 50, e.g., you run 'fc -l 0' & you might see the beginning number 163 with the most current command number being 211. It never goes all the way to 50 commands, usually just 48 before dropping one off the tail end. This is no problem, I just must be misunderstanding the man page. Another thing I found out is, after copying $HOME/.profile to $HOME.kshrc, removing all mention of HISTFILE & HISTSIZE from .kshrc & putting only the following in .profile HISTSIZE=50;export HISTSIZE HISTFILE=.ksh_history;export HISTFILE ENV=$HOME/.kshrc export ENV it works just the same as if there was no .kshrc file & everything was still all in .profile. I've got it running one way on one box & the other way on another box, & they're both working. Why they didn't work before is a mystery to me. But, I learned something anyway about being able to do it two different ways. Thanks for the answer. -- Denny White All messages scanned by ClamAssassin http://jameslick.com/clamassassin/ =============================================================== GnuPG key : 0x1644E79A | http://wwwkeys.nl.pgp.net Fingerprint: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A =============================================================== iD8DBQFHnoXpy0Ty5RZE55oRAlWQAJ0dPTy8YPFpLUkFhwvffPPBGqQlegCgyCD/ wiyKY3CVLCv20grRO5N7dgc= =lGiL -----END PGP SIGNATURE-----