[comp.misc] CI.STK history function

ryan@sjuphil.uucp (Patrick M. Ryan) (02/20/90)

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.

Please email responses and I'll post a summary.

-- 
patrick m. ryan
  ryan%sjuphil.sju.edu@bpa.bell-atl.com
  {bpa|burdvax|princeton|rutgers}!sjuphil!ryan
  pmr@gemini.gsfc.nasa.gov

tml@hemuli.tik.vtt.fi (Tor Lillqvist) (02/20/90)

In article <1990Feb19.235123.5458@sjuphil.uucp> ryan@sjuphil.uucp (Patrick M. Ryan) writes:
>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?

\begin{flame}

This guy must be joking...  Has he really tried Emacs (or vi) editing
mode in ksh (or bash)?  I don't understand how he can claim that
RTE-A's pathetic command stack is better.

- CI: only works on HP terminals, and if EnqAck handshake
  enabled
- ksh: works on any terminal described by terminfo

- CI: only uses the terminal's local editing capabilities
  (wordprocessor-like fashion, sure...  if you call edit/1000 a
  wordprocessor) 
- ksh: you can move to end of line with Control-e, over a word with
  Meta-f, etc.  Numeric args (Control-U, Meta-[1-9] work, too.

- CI: no searching
- ksh: Control-R searches for command matching string

- CI: if the command line you want to re-execute was longer that 80
  chars, tough...
- ksh: scrolls horizontally

That said above for ksh also goes for bash (the GNU Bourne Again
Shell), only more so.  Let's hope the next version will compile and
work well on HP-UX systems, too.

\end{flame}
-- 
Tor Lillqvist,
working, but not speaking, for the Technical Research Centre of Finland