Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ncar!ames!pacbell!sactoh0!tree!asmodeus From: asmodeus@tree.UUCP (Jonathan Ballard) Newsgroups: comp.sources.d Subject: Re: Bourne Again Shell? Message-ID: <237@tree.UUCP> Date: 14 Mar 89 03:54:45 GMT References: <26563@teknowledge-vaxc.ARPA> <46100006@hcx3> <1491@vicom.COM> <10659@stb.UUCP> Organization: TREE BBS (916)-349-0385 Sacramento, Ca Lines: 41 > Ok. history | fgrep foo | tail -3 | head -1 > !xyz:0-3 bar !xyz:5-$ > > Done. Readable. I have no "xyz" command so this trick is useless for me. Just wanted to say that piping isn't only for csh. Try doing it without piping in csh. This can't be executed unless you did it with sh -c `...` type format. > > Now, my turn: How do you combine multiple commands in the KSH history > mode? My copy of ksh does not implement vi's yank feature, so I cannot > combine parts from command 32 with command 35. > Well... mine does and a "32GY35G$p" will combine them. Maybe you used "yy" instead of "Y" as a yank command. Another way would be to type "fc -e" and edit the history with the editor you chose. (real editor - not editor look alike) Then when done just execute that line. > Also, ksh's vi mode has the /'s and ?'s backwards, as well as G (which > goes to the first command, not the last command). > > (I know what you'll say, think of editing a file where the new lines go at > the top. But then why can't I say 1G, and why are the numbers on the lines > backwards?) / searchs downwards in a file - search backwards in history ? searchs upwards in a file - searches forwards in history G alone will goto the least numbered history line. But with a number before it then it will try to go to that the history line number. The numbers are on the l are backwards? Since when? -- ----Asmodeus - Jonathan Ballard ..!csusac!tree!asmodeus ..!pacbell!sactoh0!tree!asmodeus "I'm going to create the best game ever heard of! Might take a few years thou..." -me