[comp.unix.questions] read in to history list

mike@ivory.SanDiego.NCR.COM (Michael Lodman) (03/01/88)

Does someone know of a way to read commands into a history list
under csh? I have some commands that I would like read in at
login time.

-- 
Michael Lodman  (619) 485-3335
Advanced Development NCR Corporation E&M San Diego
mike.lodman@ivory.SanDiego.NCR.COM 
{sdcsvax,cbatt,dcdwest,nosc.ARPA,ihnp4}!ncr-sd!ivory!mike

When you die, if you've been very, very good, you'll go to ... Montana.

morrell@hpsal2.HP.COM (Michael Morrell) (03/02/88)

/ hpsal2:comp.unix.questions / mike@ivory.SanDiego.NCR.COM (Michael Lodman) /  8:58 am  Feb 29, 1988 /
Does someone know of a way to read commands into a history list
under csh? I have some commands that I would like read in at
login time.

-- 
Michael Lodman  (619) 485-3335
Advanced Development NCR Corporation E&M San Diego
mike.lodman@ivory.SanDiego.NCR.COM 
{sdcsvax,cbatt,dcdwest,nosc.ARPA,ihnp4}!ncr-sd!ivory!mike
----------

Try: source -h file

It's documented for 4.1BSD csh.  It does not work on HP-UX (why?).

bd@hpsemc.HP.COM (bob desinger) (03/02/88)

Michael Lodman (mike@ivory.SanDiego.NCR.COM) writes:
> Does someone know of a way to read commands into a history list
> under csh?

No, but if you feel like switching to the Korn shell (and you have it
on your machine) the `print -s' command does exactly that.

bob desinger

ford@kenobi.UUCP (Mike Ditto) (03/03/88)

Posting-Front-End: GNU Emacs 18.41.10 of Fri Oct  2 1987 on kenobi (usg-unix-v)


In article <323@ivory.SanDiego.NCR.COM> mike@ivory.SanDiego.NCR.COM (Michael Lodman) writes:

> Does someone know of a way to read commands into a history list
> under csh? I have some commands that I would like read in at
> login time.

If you have a real-live BSD C-shell, you can use "source -h <filename>".
Most C-shells I have used (mostly on SysV) do not support this, however.


					-=] Ford [=-

"Well, he didn't know what to do, so	(In Real Life:  Mike Ditto)
he decided to look at the government,	ford%kenobi@crash.CTS.COM
to see what they did, and scale it	...!sdcsvax!crash!kenobi!ford
down and run his life that way." -- Laurie Anderson

dan@maccs.UUCP (Dan Trottier) (03/04/88)

In article <323@ivory.SanDiego.NCR.COM> mike@ivory.SanDiego.NCR.COM (Michael Lodman) writes:
>Does someone know of a way to read commands into a history list
>under csh? I have some commands that I would like read in at
>login time.

Set the csh variable savehist (i.e. savehist=50) in your .login file.
Create a file say .preload with the history commands you want to preload.
Add the following command to your .login file "mv .preload .history".

Voila. You have whatever commands you need at login. The question is
can you create a history list which does not change. It would be useful
to have a set list of history commands to chose from. Yes you can alias
these commands but it's not the same thing.

-- 
       A.I. - is a three toed sloth!        | ...!uunet!mnetor!maccs!dan
-- Official scrabble players dictionary --  | dan@mcmaster.BITNET

irf@kuling.UUCP (Bo Thide) (03/12/88)

In article <2450002@hpsal2.HP.COM> morrell@hpsal2.HP.COM (Michael
Morrell) writes:
>/ hpsal2:comp.unix.questions / mike@ivory.SanDiego.NCR.COM (Michael
>Lodman) /  8:58 am  Feb 29, 1988 /
>Does someone know of a way to read commands into a history list
>under csh? I have some commands that I would like read in at
>login time.
>Try: source -h file
>
>It's documented for 4.1BSD csh.  It does not work on HP-UX (why?).

I ask myself the same thing.  Strangely enough does 'history -h'
work in HP-UX even though it is not documented!  So I thought that
'source -h' should work too and I even mentioned that in one of
my bug reports, hoping that HP, in their ambition to please their
customers ( ;-> ), would implement 'source -h'.

Another possible way to add to the history buffer would be to
update the $HOME/.history file at login time.  I usually play
around with that file to remove duplicate commands (an idea
I got from an article in "HP Communicator").

BTW, there are a few other undocumented commands available in HP-UX
'csh'.  One is 'bye' which seems to work the same way as 'logout'/'exit'.

-- 
>>> Bo Thide', Swedish Institute of Space Physics, S-755 90 Uppsala, Sweden <<<  Phone (+46) 18-300020.  Telex: 76036 (IRFUPP S).  UUCP: ..enea!kuling!irfu!bt