[comp.unix.questions] history/savehist variables in csh

ec@shapetc.UUCP (Enrico Chiarucci) (02/21/89)

In my .login file I have the following lines (in a more or less vanilla
Sun-2 flavour of unix):

	set history=128
	set savehist=16
	source -h ~/.history

wishing to keep 128 commands in the history file, but to save only 16 of
them across login sessions.

Upon logging in, however, I consistently get 32 commands preserved from
the previous session. .login and .cshrc are also used to set and reset
the prompt to something like "dir,event #" but I do not think this has
a bearing on the problem.

I would appreciate any hint as to the possible cause of the unexpected
behaviour. Sorry if the question is well known, and the answer evident,
as my knowledge about these matters is somewhat limited.

enrico

devusr@relay.nswc.navy.mil (02/22/89)

enrico writes:
> In my .login file I have the following lines ...
>	set history=128
>	set savehist=16
>	source -h ~/.history


The last line is not needed. csh does this `source' for you automatically.

Dave

---
Dave Paulson	dpaulso@relay.nswc.navy.mil	(703)663-2137
"I've upped my standards; now up yours" -- Pat Paulsen

sam@bsu-cs.UUCP (B. Sam Blanchard) (02/25/89)

In article <345@shapetc.UUCP> ec@shapetc.UUCP (Enrico Chiarucci) writes:
>
>In my .login file I have the following lines (in a more or less vanilla
>Sun-2 flavour of unix):
>	source -h ~/.history
>
>Upon logging in, however, I consistently get 32 commands preserved from
>the previous session. .login and .cshrc are also used to set and reset
>
>enrico

In Article 10884 of comp.unix.questions:
]The last line is not needed. csh does this `source' for you automatically.
]
] Dave Paulson	dpaulso@relay.nswc.navy.mil	(703)663-2137

    Correct me if I'm wrong but--
	source -h ~/.history
    adds .history to the current history.  I.e. (maybe you knew this Dave)
    the 32 command history that Enrico has after his .login finishes is 
    the contents of his .history file followed by the contents of his
    .history file.  ;-)
-- 
B. Sam Blanchard         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!sam

morrell@hpsal2.HP.COM (Michael Morrell) (02/25/89)

/ hpsal2:comp.unix.questions / ec@shapetc.UUCP (Enrico Chiarucci) /  5:07 am  Feb 21, 1989 /

In my .login file I have the following lines (in a more or less vanilla
Sun-2 flavour of unix):

	set history=128
	set savehist=16
	source -h ~/.history

wishing to keep 128 commands in the history file, but to save only 16 of
them across login sessions.

Upon logging in, however, I consistently get 32 commands preserved from
the previous session.

enrico
----------

Are the second 16 of the 32 commands duplicates of the first 16?  I believe
the savehist feature automatically inserts the last 16 commands into your
history stack and your invocation of "source -h" adds them in again.

 Michael

dpaulso@relay.nswc.navy.mil (02/28/89)

A while back, I wrote:
>>The last line is not needed. csh does this `source' for you automatically.

 Sam Blanchard responded:
>	source -h ~/.history
>    adds .history to the current history.  I.e. (maybe you knew this Dave)
>    the 32 command history that Enrico has after his .login finishes is 
>    the contents of his .history file followed by the contents of his
>    .history file.  ;-)

that's right. in my inimitable clusmy fashion, i was alluding to the
fact that the mere existence of a .history file is sufficient to cause
the saved history to be placed in the current session's history list.
thus, 'the last line is not needed'

>B. Sam Blanchard         UUCP:  <backbones>!{iuvax,pur-ee}!bsu-cs!sam

dave

---
Dave Paulson	dpaulso@relay.nswc.navy.mil	(703)663-2137
"I've upped my standards; now up yours" -- Pat Paulsen

probinso@psu-cs.UUCP (Pat Robinson) (03/01/89)

In article <345@shapetc.UUCP> ec@shapetc.UUCP (Enrico Chiarucci) writes:
>
>In my .login file I have the following lines (in a more or less vanilla
>Sun-2 flavour of unix):
>
>	set history=128
>	set savehist=16
>	source -h ~/.history
>
>wishing to keep 128 commands in the history file, but to save only 16 of
>them across login sessions.
>

Just put the set savehist=16 in your .logout not your .login.  You should
then only get 16 saved.


Pat Robinson     

UUCP:    {ucbvax, decvax, allegra, hplabs}!tektronix!psu-cs!probinso 
CSNET:   probinso@cs.pdx.edu
ARPANET: probinso%cs.pdx.edu@relay.cs.net