Path: utzoo!attcan!uunet!samsung!usc!ucsd!ucsdhub!hp-sdd!hplabs!hp-ses!hpcuhb!hpda!hpcuhc!mck From: mck@hpcuhc.HP.COM (Doug McKenzie) Newsgroups: comp.sys.hp Subject: Re: CI.STK history function Message-ID: <530006@hpcuhc.HP.COM> Date: 21 Feb 90 20:45:51 GMT References: <1990Feb19.235123.5458@sjuphil.uucp> Organization: Hewlett Packard, Cupertino Lines: 30 > / hpcuhc:comp.sys.hp / ryan@sjuphil.uucp (Patrick M. Ryan) / 3:51 pm Feb 19, 1990 / > I have never been overly thrilled with the history capabilities of any > of the Un*x shells which I have used (csh, sh, ksh, tcsh, etc.). One > history command I do like, though, is the one in HP's RTE-A running > on an HP 1000. The way it works is this: Type '/' and the system > will display the last 10 (or so) commands you have executed (in > much the same way as csh's 'history'). One then simply moves the > cursor up the list of commands and hits RETURN on the one he or > she wishes to repeat. The user also has the option, while perusing > the list, of editing a command in wordprocessor-like fashion before > executing it. If the user types '//' instead of '/', just the last > command is displayed. Easy, no? > > The reason for this post is to see if anyone has a neat hack by which > I might emulate this RTE-A history capability in the Berkeley shell. > Suggestions and partial solutions are welcome. For what it's worth, here's an alias that will do what you want. It was great, until I switched to the ksh. I'm afraid I agree with all Tor's comments in his response, too. Note that ^[ is two chars here, but should be one (escape). alias hi 'echo -n ^[J;h -h;set ss=$<;echo -n ^[R^[J^[A^[d^Q;unset ss;sleep 1' Doug McKenzie HP-UX Support mck@hpcugsya.cup.hp.com