[comp.unix.questions] Recalling Commands in Unix?

gnat@blake.acs.washington.edu (Laura Frazier) (12/23/89)

Is there any command in Unix comparable to  ^B in VMS that will allow me
to recall previous commands instead of typing them repeatedly?

Are there likewise commands like ^J , ^A, etc., that will edit
commands once I recall them?

Thanks In Advance,

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|Laura B. Frazier		|	gnat@blake.acs.washington.edu	|
|Division of Cardiology		| 					|
|University of Washington	|	Office(206) 543-3647		|
|1959 N.E. Pacific		| 	Home (206)325-6630		|
|Seattle, WA  98195   		|					|	
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

satam@ecs.umass.edu (Kirtikumar Satam) (12/26/89)

In article <5141@blake.acs.washington.edu>, 
gnat@blake.acs.washington.edu (Laura Frazier) writes:
> Is there any command in Unix comparable to  ^B in VMS that will allow me
> to recall previous commands instead of typing them repeatedly?
> 
> Are there likewise commands like ^J , ^A, etc., that will edit
> commands once I recall them?
> 

On ULTRIX, a new "csh" is provided. It allows browsing thru' commands
like VMS using up-down arrow keys. Once the command is recalled, it
can be edited using "vi" like commands i.e. 'x' for delete, 'i' for
insert etc.

But, I am not aware of any other shell on any other UNIX doing such things.

-satam
------------------------------------------------------------------------
Kirtikumar "Mumbaichaa" Satam
INTERNET : satam@ecs.umass.edu
BITNET : satam@umaecs.bitnet
217 Northwood Apts, Sunderland, MA 01375   Tel# 413-665-3222
------------------------------------------------------------------------

norm@oglvee.UUCP (Norman Joseph) (12/28/89)

From article <5141@blake.acs.washington.edu>, by gnat@blake.acs.washington.edu (Laura Frazier):
> Is there any command in Unix comparable to  ^B in VMS that will allow me
> to recall previous commands instead of typing them repeatedly?
> 
> Are there likewise commands like ^J , ^A, etc., that will edit
> commands once I recall them?

The Korn shell (ksh) has the ability to recall and re-edit command lines
in the idiom of your favorite editor (as long as it is vi or emacs).  If
your system does not have ksh, try the C shell (csh).  It contains a
cumbersome but usable syntax for recalling prior commands.  Check your
manual, your local Unix guru/system administrator, or your vendor.
-- 
Norm Joseph - Oglevee Computer System, Inc.
  UUCP: ...!{pitt,cgh}!amanue!oglvee!norm
    /* you are not expected to understand this */

tale@cs.rpi.edu (David C Lawrence) (12/28/89)

<5141@blake.acs.washington.edu> gnat@blake.acs.washington.edu (Laura Frazier):
> Is there any command in Unix comparable to ^B in VMS that will allow
> me to recall previous commands instead of typing them repeatedly?
> Are there likewise commands like ^J , ^A, etc., that will edit
> commands once I recall them?

Um, yes.  "Um" because it isn't technically Unix, but merely an
application written for Unix -- namely, the shell.  Several
interactive shells, most notably bash, tcsh, ksh and ecsh, provide
this functionality.

If you are on an AT & T box (semi-doubtful; University sites tend to
run BSD, but assumption making about what someone is running is just
plain fool-hardy) look into getting ksh from the AT & T Toolchest.  It
supports both Emacs-like and vi-like editing modes.

bash, from the Free Software Foundation and available from many sites
that archive GNU software, is similar to ksh in that it offers Bourne
shell syntax, vi- and Emacs-like modes, and better interactive use
than /bin/sh.  Major sites carrying it for anonymous ftp are
prep.ai.mit.edu and tut.cis.ohio-state.edu (osu-cis for anonymous
UUCP).

tcsh provides a very featureful overlay to csh and also supports
Emacs-like editing.  It too is carried by tut.

I have no idea where ecsh came from or whether it is still supported
by the person responsible for it.  I mention it though because it is
another option I know about.  I used to use it before switching to
tcsh a couple of years ago.  (I now use bash except on the local ACM's
3B2s, on which I use ksh.)

Dave
-- 
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

peter@ficc.uu.net (Peter da Silva) (01/02/90)

> > Is there any command in Unix comparable to ^B in VMS that will allow
> > me to recall previous commands instead of typing them repeatedly?

> Um, yes.  "Um" because it isn't technically Unix, but merely an
> application written for Unix -- namely, the shell.  Several
> interactive shells, most notably bash, tcsh, ksh and ecsh, provide
> this functionality.

Um, how about the grandaddy of all "enhanced" shells in UNIX: "csh"? It's
not screen-editor-like, but more like a line editor, but it does provide
the functionality needed (and IMHO does a better job than more agressively
interactive tools), and it predates the bourne shell!
-- 
`-_-' Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
 'U`  Also <peter@ficc.lonestar.org> or <peter@sugar.lonestar.org>.
"It was just dumb luck that Unix managed to break through the Stupidity Barrier
and become popular in spite of its inherent elegance." -- gavin@krypton.sgi.com

dce@smsc.sony.com (David Elliott) (01/02/90)

In article <524@oglvee.UUCP> norm@oglvee.UUCP (Norman Joseph) writes:
>From article <5141@blake.acs.washington.edu>, by gnat@blake.acs.washington.edu (Laura Frazier):
>> Is there any command in Unix comparable to  ^B in VMS that will allow me
>> to recall previous commands instead of typing them repeatedly?
>> 
>> Are there likewise commands like ^J , ^A, etc., that will edit
>> commands once I recall them?
<mentions ksh and csh>

In addition, don't count out ile, fep, reactivekb, and bash.

ile is a line-editor front-end written by Bob Pendleton.  It works in
the shell, or any time the tty is in canonical mode.

fep is a similar item to ile.  I forget the author's name, but I believe
it was someone from Japan.

reactivekb from Mark James et al is an AI keyboard input analyzer/guesser
(well, it's really more than that) with a line editor built in.

bash is the GNU Bourne-Again Shell from Brian Fox et al, and is an
extended shell (a la ksh) with a line editor and csh style history.

-- 
David Elliott
dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
(408)944-4073
"But Pee Wee... I don't wanna be the baby!"

guy@auspex.auspex.com (Guy Harris) (01/03/90)

>Um, yes.  "Um" because it isn't technically Unix, but merely an
>application written for Unix -- namely, the shell.

(Well, that depends on what you consider "UNIX" to be; some consider
those programs delivered with UNIX to be part of it, others don't.)

>If you are on an AT & T box (semi-doubtful; University sites tend to
>run BSD, but assumption making about what someone is running is just
>plain fool-hardy) look into getting ksh from the AT & T Toolchest.  It
>supports both Emacs-like and vi-like editing modes.

"ksh" is supplied in source form, so you're not restricted to "AT&T
boxes" (i.e., 3Bs, their 80*86 machines, and the like); you're not even
restricted to machines running System V - it can be built
under BSD-flavored systems, and possibly even under vanilla BSD.

It does cost about $2K-$3K for the source, as I remember, though.

hogan@csl.sri.com (Emmett Hogan) (01/05/90)

>>>>> On 26 Dec 89 09:13:17 GMT, satam@ecs.umass.edu (Kirtikumar Satam) said:

In article <5141@blake.acs.washington.edu>, 
 gnat@blake.acs.washington.edu (Laura Frazier) writes:
> Is there any command in Unix comparable to  ^B in VMS that will allow me
> to recall previous commands instead of typing them repeatedly?
> 
> Are there likewise commands like ^J , ^A, etc., that will edit
> commands once I recall them?
> 

Satam> On ULTRIX, a new "csh" is provided. It allows browsing thru'
Satam> commands like VMS using up-down arrow keys. Once the command is
Satam> recalled, it can be edited using "vi" like commands i.e. 'x'
Satam> for delete, 'i' for insert etc.

Satam> But, I am not aware of any other shell on any other UNIX doing
Satam> such things.

tcsh, available at most of the major FTP sites, provides you with
command line editing with Emacs commands as well as the arrow keys,
plus adds ALOT more to basic csh.  It can be compiled to work with
most of the major flavors of Unix and csh.

--
-------------------------------------------------------------------
Emmett Hogan              Computer Science Lab, SRI International
Inet: hogan@csl.sri.com   
UUCP: {ames, decwrl, pyramid, sun}!fernwood!hercules!hogan                     
USMAIL: BN179, 333 Ravenswood Ave, Menlo Park, CA  94025
PacBell: (415)859-3232 (voice), (415)859-2844 (fax)
ICBM: 37d 27' 14" North, 122d 10' 52" West
-------------------------------------------------------------------

gwyn@smoke.BRL.MIL (Doug Gwyn) (01/05/90)

In article <5141@blake.acs.washington.edu> gnat@blake.acs.washington.edu (Laura Frazier) writes:
>Is there any command in Unix comparable to  ^B in VMS that will allow me
>to recall previous commands instead of typing them repeatedly?
>Are there likewise commands like ^J , ^A, etc., that will edit
>commands once I recall them?

There are several "Tenex-like" shells available, including both Cshell
and Bourne shell variants.  A few input line-editing "wrapper" utilities
have also been posted in the past; they have the advantage that they
work with applications, not just at shell command level.  Then there
are terminals like the one I'm typing on (AT&T model 630) that support
various forms of mouse-driven text editing IN THE TERMINAL and thus make
it available even with non-UNIX systems.

prc@erbe.se (Robert Claeson) (01/05/90)

In article <8769.2597362d@ecs.umass.edu>, satam@ecs.umass.edu (Kirtikumar Satam) writes:
> In article <5141@blake.acs.washington.edu>, 
> gnat@blake.acs.washington.edu (Laura Frazier) writes:

> > Is there any command in Unix comparable to  ^B in VMS that will allow me
> > to recall previous commands instead of typing them repeatedly?

> On ULTRIX, a new "csh" is provided. It allows browsing thru' commands
> like VMS using up-down arrow keys. Once the command is recalled, it
> can be edited using "vi" like commands i.e. 'x' for delete, 'i' for
> insert etc.

The Korn shell (usually /bin/ksh on those systems that have it) has command-
line editing using vi, Unipress emacs or Gnu emacs commands. No support for
arrow keys, though.

BBC (Boston Business Computing) has a DCL clone shell (VCL) that includes
most of the common VMS commands, including the HELP system. It supports
full DCL-like command-line editing. There's an EDT clone as well.

-- 
          Robert Claeson      E-mail: rclaeson@erbe.se
	  ERBE DATA AB

root@spocm2.UUCP (System Administrator) (01/09/90)

] Satam> On ULTRIX, a new "csh" is provided. It allows browsing thru'
] Satam> commands like VMS using up-down arrow keys. Once the command is
] Satam> recalled, it can be edited using "vi" like commands i.e. 'x'
] Satam> for delete, 'i' for insert etc.
] 
] Satam> But, I am not aware of any other shell on any other UNIX doing
] Satam> such things.
] 
] tcsh, available at most of the major FTP sites, provides you with
] command line editing with Emacs commands as well as the arrow keys,
] plus adds ALOT more to basic csh.  It can be compiled to work with
] most of the major flavors of Unix and csh.
] 
] -------------------------------------------------------------------

And for those of us who dislike the csh syntax, there is the ksh (Korn shell)
which gives you a command history plus command line editing (Emacs-style or
vi style), while preserving the standard Bourne shell syntax. 
I first started using it at AT&T many years ago and I have seen it 
advertised in Byte magazine now and then, but can't recall the name of 
the company that markets it.

Leo Vermeulen               Philips TDS, Stockholm, Sweden
(..!sunic!spocm2!lhv)
-------------------------------------------------------------------