🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #1076

Re: Questions about rewriting the History function.

#1076
From: Bill Stewart 201-949-0705 erebus...
Date: Sun, 21 Oct 1990 01:02
42 lines
2807 bytes
In article <1990Oct19.165721.7584@polyof.poly.edu>, roseann@polyof.poly.edu,
(RoseAnn Ammendolea) (or Marc someone using her account?) writes:
] I am working on a senior project to rewrite the history function for UNIX.
] My goal is to have the new history function work like it does in
] MS_DOS.  i.e. I want to be able to call up past commands and edit them
] by using the control <hjkl> characters.  Additionally, I would like to
] write this as a stand alone program so that I do not have to rewrite the shell.

The main problem is that UNIX doesn't process or remember the command lines,
(except to the crude extent that the accounting system does) -
it's all done by the shell.  The commands you type are simply input
to the shell, which does any interpretation, and fork()/exec()s the
command if it's a "real" command, or just does it if it's a shell builtin.

Depending on what shell you use, it may or may not have a history
capability, and that history may be stored in a file or in memory.
If it's in a file, it may not be absolutely up-to-date.
You'll have to play around with shells you like, and you really need source.

The old Bourne shell (/bin/sh) doesn't do history.
The C shell does, with the ugly !! command-based interface.
The Korn shell (ksh) does history, stores it in a file, and gives
	you an editor-interface as well as a command-based interface.
Various intellectual derivatives like BASH and tcsh are similar.
The 9th edition shell gave you something lean, mean, and clean, as always.
The adventure shell doesn't have history, but it has xyzzy. :-)

MS-DOS itself doesn't have a 'history' command.  The F1 and F3 keys
let you get the most recent command, unless it's been trashed;
I think this is managed by command.com rather than DOS.
There are a couple of history commands running around, including
HISTORY and ANARKEY; don't know if any of them come with source.

The other good thing about VMS, besides HELP, was command editing.
It probably only worked for VT100 terminals, but it was there and easy.

			Good luck
-- 
					Thanks; Bill
# Bill Stewart 908-949-0705 erebus.att.com!wcs AT&T Bell Labs 4M-312 Holmdel NJ
Government is like an elephant on drugs: It's very confused, makes lots of noise,
can't do anything well, stomps on anyone in its way, and it sure eats a lot.
Technical Details
Message-ID: <1990Oct21.010205.24695@cbnewsh.att.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!cbnewsh!wcs
References: <1990Oct19.165721.7584@polyof.poly.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.programmer,comp.unix.questions
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!cbnewsh!wcs
From: wcs@cbnewsh.att.com (Bill Stewart 201-949-0705 erebus.att.com!wcs)
Subject: Re: Questions about rewriting the History function.
Organization: AT&T Bell Labs Government Communications
Date: Sun, 21 Oct 90 01:02:05 GMT
Message-ID: <1990Oct21.010205.24695@cbnewsh.att.com>
References: <1990Oct19.165721.7584@polyof.poly.edu>
Lines: 42