[comp.unix.questions] history tricks...

gefuchs@wotan.uucp (Gill E. Fuchs) (01/05/89)

Hello Net,

2 history related questions:

   1 -   how to redefine "foo" (anything else, that is) instead of
         the "!" for the "YO UNIX, HISTORY COMMAND COMING UP"...
      
   2 -   if #1 works, how about defining something which will not
         require a <ret> (ala up arrow in vms) to retrieve the last
         command.   On the other hand, once i have the last command
         up, i want to change a character and only then unleash it
         with the appropriate <ret>

can do?

muchas gracias
	-gill
            one dude with not enough history...   :-)

hiebeler@rpics (Dave Hiebeler) (01/05/89)

In article <945@cmx.npac.syr.edu> gefuchs@top.cis.syr.edu (Gill E. Fuchs) writes:
>Hello Net,
>
>2 history related questions:
>   2 -   if #1 works, how about defining something which will not
>         require a <ret> (ala up arrow in vms) to retrieve the last
>         command.   On the other hand, once i have the last command
>         up, i want to change a character and only then unleash it
>         with the appropriate <ret>

  There is something that will do what I believe you want, called "ecsh".
It's basically csh, but with some emacs-type editing features added in.
That is, you can move up to previous command-lines, and edit them, and lots
of nice stuff like that, before sending the final command-line off to the
shell.  It's pretty handy.  We have it here at RPI, but I don't know offhand
where you can get a copy (I don't have access to the source right now).

  Perhaps someone else can tell you where you might get a copy?

  Oh, ecsh can also work in a vi-type mode, for those who don't use emacs.
I don't know how well that mode works though, as I haven't really experimented
with it..

----
Dave Hiebeler      Internet: hiebeler@cs.rpi.edu  (preferred address)
R.D. Box 225A                userfrzk%mts@itsgw.rpi.edu
Chatham, NY 12037    Bitnet: userfrzk@rpitsmts.bitnet
  "xue zai xao"     "...I can't remember what I was going to say..."

kyriazis@rpics (George Kyriazis) (01/05/89)

In article <945@cmx.npac.syr.edu> gefuchs@top.cis.syr.edu (Gill E. Fuchs) writes:
>Hello Net,
>
>2 history related questions:
>
>   1 -   how to redefine "foo" (anything else, that is) instead of
>         the "!" for the "YO UNIX, HISTORY COMMAND COMING UP"...
>      

I would assume that you can't do that in csh.

>   2 -   if #1 works, how about defining something which will not
>         require a <ret> (ala up arrow in vms) to retrieve the last
>         command.   On the other hand, once i have the last command
>         up, i want to change a character and only then unleash it
>         with the appropriate <ret>
>
You can use ksh to do that.  By pressing ESC you go into some wierd mode
were you acan either use vi or emacs keys to move back into history.  You
can also search back in history for a given command and also you can 
do command substitution and history in a single command (you can alias
it also).

You might want to take a look at ksh then.  Dont't ask me too much though,
I use csh!



  George Kyriazis
  kyriazis@turing.cs.rpi.edu
  kyriazis@ss0.cicg.rpi.edu
------------------------------

mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) (01/05/89)

> <945@cmx.npac.syr.edu> gefuchs@top.cis.syr.edu (Gill E. Fuchs):
>   1 -   how to redefine "foo" (anything else, that is) instead of
>         the "!" for the "YO UNIX, HISTORY COMMAND COMING UP"...

set histchars = \!\^	# is the default

>   2 -   if #1 works, how about defining something which will not
>         require a <ret> (ala up arrow in vms) to retrieve the last
>         command.   On the other hand, once i have the last command
>         up, i want to change a character and only then unleash it
>         with the appropriate <ret>

Not in vanilla csh.  There are variations like tcsh, ecsh and add-ons
like led and ile that will do that.  I think you have to be a source
licensee to be able to make use of the csh diffs for making tcsh (and
ecsh?).  Led and ile may be available from comp.sources.unix archives.

Mike Khaw
-- 
internet: mkhaw@teknowledge.arpa
uucp:	  {uunet|sun|ucbvax|decwrl|ames|hplabs}!mkhaw%teknowledge.arpa
hardcopy: Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303

dutler@ihlpm.ATT.COM (Stan Dutler) (01/05/89)

From article <945@cmx.npac.syr.edu>, by gefuchs@wotan.uucp (Gill E. Fuchs):

>    2 -   if #1 works, how about defining something which will not
>          require a <ret> (ala up arrow in vms) to retrieve the last
>          command.   On the other hand, once i have the last command
>          up, i want to change a character and only then unleash it
>          with the appropriate <ret>
> 

Sounds like you could use the history mechanism in ksh. It does all
of the above and more. It even works better than command editing
in VMS (I have used both).