ksh history question

2008-01-28 Thread Denny White
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 

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.

-- 

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
===
iD8DBQFHnQ+ey0Ty5RZE55oRAm+IAJ4mFSIXHqORlxAmbuIu4VTOd7Z35QCgpwDP
X6R0e88UGv5D/5VGHG4rX6I=
=hMAH
-END PGP SIGNATURE-



Re: ksh history question

2008-01-28 Thread Denny White
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

On Mon, Jan 28, 2008 at 11:32:00PM +, 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-



Re: ksh history question

2008-01-28 Thread Jason McIntyre
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



Re: ksh history question

2008-01-28 Thread Steve Mayer

Have you tried it without the quotes?

HISTSIZE=50

Steve

On Jan 27, 2008, at 3:27 PM, Denny White wrote:


-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

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.

--

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
===
iD8DBQFHnQ+ey0Ty5RZE55oRAm+IAJ4mFSIXHqORlxAmbuIu4VTOd7Z35QCgpwDP
X6R0e88UGv5D/5VGHG4rX6I=
=hMAH
-END PGP SIGNATURE-




Re: ksh history question

2008-01-28 Thread Jordi Espasa Clofent

HISTFILE=.ksh_history
HISTSIZE=50


Try it without double quotes on HISTSIZE value; and remember to export them.

--
Thanks,
Jordi Espasa Clofent



Re: ksh history question

2008-01-28 Thread Denny White
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

On Mon, Jan 28, 2008 at 11:56:56PM +0100, Jordi Espasa Clofent sez:
 HISTFILE=.ksh_history
 HISTSIZE=50
 
 Try it without double quotes on HISTSIZE value; and remember to export them.
 
 -- 
 Thanks,
 Jordi Espasa Clofent
 

Thanks for the reply, Jordi. Yeah, I saw that while googling around
 tried it, but by the time I'd posted my question, I'd taken the
quotes off. It still wasn't working. Why, all of a sudden it started
working last night, I don't know. I'm just glad it did. I think I
copied that in from a something other than the working file when I
posted to [EMAIL PROTECTED] Probably a .profile~ in $HOME. My bad. Thanks for
answering, though.

-- 

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
===
iD8DBQFHnr4Ly0Ty5RZE55oRAlbNAKCogEisCCKulQyADSlPVptb/Rd1fACgg2XG
n8nZLrmDibOfWCyJobqC3M0=
=Z76v
-END PGP SIGNATURE-



Re: ksh history question

2008-01-28 Thread Denny White
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1

 On Jan 27, 2008, at 3:27 PM, 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.
 
 -- 
 
 Denny White
 
On Mon, Jan 28, 2008 at 03:26:20PM -0800, Steve Mayer sez:
 Have you tried it without the quotes?
 
 HISTSIZE=50
 
 Steve

Yeah, dumbass me, I just answered the same question in another reply.
Should've looked at the rest of the messages. ;) Anyway, yeah, I had
tried it both ways  it still didn't work. Like I said before, why
all of a sudden it started working, I don't know. But it now it works.
Each time I made changes, I tried various ways of getting it to take
effect. I did '. ./.profile' to get the system to reread it, exited
 logged back in, etc. Strange problem but now it's resolved. Thanks
for the help, Steve. 

-- 

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
===
iD8DBQFHnr+4y0Ty5RZE55oRAmM3AKDRVZQx0wLMBbpXVPRIi3oqaDdouACgjtIN
sUKw7wiPZednI/fZvRCT1bw=
=nwNv
-END PGP SIGNATURE-