phd_jacquier@gsbacd.uchicago (09/12/90)
Hi, I am a beginner at UNIX and have the following question. Why is there not a simple way to recall, edit and reissue old commands like in DOS with dosedit or scrollrecall, or in VMS ? It seems to me that it's a basic convenience that is unavailable in UNIX. frankly it blows my mind. There must be something trivial I am missing but I have asked everybody around and nobody has anything to suggest. (History is not satisfactory since it does not allow the quick review and editing of previous commands). Thanks Eric
rwelch@diana.cair.du.edu (RANDY S WELCH) (09/12/90)
See if you have ksh. That has just what you are looking for. bash too I belive. -randy -- Randy Welch Mail to : ...!ncar!scicom!bldr!randy or rwelch@du.edu Boulder, CO VOICE : 303-442-6717 "Unfortunately, life contains an unavoidable element of unpredictability" -David Lynch "The Angriest Dog in the World"
davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (09/13/90)
In article <1990Sep11.230946.23611@midway.uchicago.edu> phd_jacquier@gsbacd.uchicago writes: | Why is there not a simple way to recall, edit and reissue old commands | like in DOS with dosedit or scrollrecall, or in VMS ? There are several solutions. Perhaps the best is Korn shell, which has emacs, gemacs, or vi style editing of the recent command lines. There are also a couple of programs which run using the "line discipline" hook to provide editing. Sorry I don't remember details on this one. -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me
jourdan@minos.inria.fr (Martin Jourdan) (09/13/90)
And tcsh, too... Martin Jourdan <jourdan@minos.inria.fr>, INRIA, Rocquencourt, France. Why do we need all these %$#@%$# disclaimers?!?
staff@cadlab.sublink.ORG (Alex Martelli) (09/13/90)
phd_jacquier@gsbacd.uchicago writes: >Hi, >I am a beginner at UNIX and have the following question. >Why is there not a simple way to recall, edit and reissue old commands >like in DOS with dosedit or scrollrecall, or in VMS ? I predict you'll get MANY answers to this... I'm answering anyway to pass the information that on Ultrix 4.0, the C shell (csh) has the command recall ability, e.g. press up arrow to see the last command you gave (and so up in the history), PLUS you can edit to your heart's content with a goody subset of vi. In the previous release of Ultrix, you got this function in the unsupported "new C shell". A more portable solution is the Korn shell from AT&T, ksh; a free one from Free Software Foundation is Bourne Again SHell, bash. These two also have a fuller vi-subset, or emacs if you prefer, and ksh allows you, with the fc builtin command, to recall any portion of your history into a temporary file and edit THAT, with ANY editor of your choice (full-screen or otherwise) to get, not just one command, but a full-fledged shell-script, which is then auto-executed. On a less grand scale, there is mash, the sh-subset-cum-dosedit, which runs comfortably on, say, Coherent (64K max limit on programs). It's public domain, too, though the only place I know where you could download it from is a BBS right here in Bologna, Italy... bit costly, that :-). Enough choices for you? -- Alex Martelli - CAD.LAB s.p.a., v. Stalingrado 45, Bologna, Italia Email: (work:) staff@cadlab.sublink.org, (home:) alex@am.sublink.org Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434; Fax: ++39 (51) 366964 (work only; any time of day or night).
dave@westmark.UUCP (Dave Levenson) (09/15/90)
In article <1990Sep11.230946.23611@midway.uchicago.edu>, phd_jacquier@gsbacd.uchicago writes: > I am a beginner at UNIX and have the following question. > Why is there not a simple way to recall, edit and reissue old commands > like in DOS with dosedit or scrollrecall, or in VMS ? You don't indicate whose UNIX you're running. Most of them offer an alternative to the standard /bin/sh known as ksh (also called k-shell or Korn shell, after David Korn, its creator). Ksh offers command history with editing (use either vi- or emacs-style editing commands) and several other convenience features. -- Dave Levenson Voice: 908 647 0900 Fax: 908 647 6857 Westmark, Inc. UUCP: {uunet | rutgers | att}!westmark!dave Warren, NJ, USA AT&T Mail: !westmark!dave [The Man in the Mooney]
dansmith@well.sf.ca.us (Daniel Smith) (09/22/90)
>In article <1990Sep11.230946.23611@midway.uchicago.edu>, phd_jacquier@gsbacd.uchicago writes: >> I am a beginner at UNIX and have the following question. >> Why is there not a simple way to recall, edit and reissue old commands >> like in DOS with dosedit or scrollrecall, or in VMS ? tcsh, get it from osu-cis.edu. They have at least Sun 3 and 4 binaries available via ftp (someone please jump in and correct me/add to this). Does BASH (GNU) offer command line editing? I'm seem to think that it does. Daniel -- Dan "Bucko" Smith dansmith@well.sf.ca.us daniel@island.uu.net unicom!daniel@pacbell.com ph: (415) 332 3278 (h), 258 2136 (w) disclaimer: Island's coffee was laced :-) My mind likes Cyberstuff, my eyes films, my hands guitar, my feet skiing...
asylvain@felix.UUCP (Alvin E. Sylvain) (09/29/90)
This is one of probably many responses, but I have also included a long list of C shell history substitution commands that Unix netters may find interesting (I hope). In article <269@cadlab.sublink.ORG> staff@cadlab.sublink.ORG (Alex Martelli) writes: >phd_jacquier@gsbacd.uchicago writes: > >>Hi, >>I am a beginner at UNIX and have the following question. >>Why is there not a simple way to recall, edit and reissue old commands >>like in DOS with dosedit or scrollrecall, or in VMS ? > >I predict you'll get MANY answers to this... I'm answering anyway to >pass the information that on Ultrix 4.0, the C shell (csh) has the >command recall ability, e.g. press up arrow to see the last command >you gave (and so up in the history), PLUS you can edit to your >heart's content with a goody subset of vi. In the previous release >of Ultrix, you got this function in the unsupported "new C shell". [ ... ] Actually that sounds like Kornshell, which incidentally has a much better history substitution mechanism. BUT, you are more likely to already have /bin/csh on your system. You must take some action (buy? scrounge? forage?) to get /bin/ksh. You probably can't get DOSEDIT syntax, but at least history substitution of some kind is available. First off, make sure you are running the C shell. This can generally be guaranteed on a permanent basis with the following command: chsh <your-user-name> /bin/csh If this doesn't work, talk to your system administrator. Standard csh history commands are summarized as follows: (quoted and summarized from "The CSH Reference Guide", A System Publication, 711 Chemeketa Dr, San Jose CA 95123 no association whatsoevery) history - print the current list of 'old' commands set history=n - tell the C shell to only remember n commands (generally done in your .login file) to get historical events: !n - execute command n !-n - execute command n relative to current command !str - command that begins with str !?str - command that contains str !! - previous command ^x^y - substitute x for y on previous line from previous command line, retrieve: :0 - first word :n - argument n :^ - first argument :$ - last argument :% - word matched by ? search :x-y - range of words from x to y :-y - range of words from first to y :* - all args :x* - range of arguments from x to last :x- - range of words from previous command, modify: :ge - return filename suffixes :gh - return root pathname :gr - return filename prefixes :gs/x/y - substitute all occurances of x for y :gt - return tail pathname :g& - repeat previous substitution :e - return filename suffix of first argument :h - return root pathname of first argument :q - quote substituted words to prevent further substitution :r - return filename prefix of first argument :s/x/y - substitute first occurance of x for y :t - return tail pathname part of first argument :x - same as q except quote words individually :& - repeat previous substitution Example: You type in the command: rm fred barney You get the error message that fred and barney are unavailable for removal (or some such). You hit your head and say, "Oh, that's right ..." Then you type: !!:s/f/F/:s/b/B the shell echoes (just so you know what you changed to) rm Fred Barney and removes the files Fred and Barney. Quick analysis of above: !! previous command (as opposed to !56, which would be the 56th command) :s/f/F/ change the first little f to a big F :s/b/B change the first little b to a big B Another example: rm Fred Barney No no no, you already removed those two! Weren't you following the examples? What you need now is to re-make them!! Type: ^rm^make and you'll get: make Fred Barney and the make program is run to re-construct files Fred and Barney. Have fun. ------------------------------------------------------------------------ "I got protection for my | Alvin "the Chipmunk" Sylvain affections, so swing your | Natch, nobody'd be *fool* enough to have bootie in my direction!" | *my* opinions, 'ceptin' *me*, of course! -=--=--=--"BANDWIDTH?? WE DON'T NEED NO STINKING BANDWIDTH!!"--=--=--=- -- ------------------------------------------------------------------------ "I got protection for my | Alvin "the Chipmunk" Sylvain affections, so swing your | Natch, nobody'd be *fool* enough to have bootie in my direction!" | *my* opinions, 'ceptin' *me*, of course! -=--=--=--"BANDWIDTH?? WE DON'T NEED NO STINKING BANDWIDTH!!"--=--=--=-
mwprange@vela.acs.oakland.edu (Manfred W. Prange) (09/29/90)
In article <269@cadlab.sublink.ORG> staff@cadlab.sublink.ORG (Alex Martelli) writes: >On a less grand scale, there is mash, the sh-subset-cum-dosedit, >which runs comfortably on, say, Coherent (64K max limit on programs). >It's public domain, too, though the only place I know where you could >download it from is a BBS right here in Bologna, Italy... bit costly, >that :-). Enough choices for you? I am looking for a shell with command editing/retrieval that will run under Coherent - or anything that will compile under Coherent. :-) Does anyone know of an FTP site for mash? -MWP