Xref: utzoo comp.os.vms:31138 comp.unix.questions:26036 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!aristotle!pjs From: pjs@aristotle.JPL.NASA.gov (Peter Scott) Newsgroups: comp.os.vms,comp.unix.questions Subject: Windowed search capability? Message-ID: <1990Oct7.235518.16785@elroy.jpl.nasa.gov> Date: 7 Oct 90 23:55:18 GMT Sender: news@elroy.jpl.nasa.gov (Usenet) Reply-To: pjs@aristotle.jpl.nasa.gov Followup-To: comp.unix.questions Distribution: na Organization: Jet Propulsion Laboratory, NASA/Caltech Lines: 20 Nntp-Posting-Host: aristotle.jpl.nasa.gov Second try at posting; occasionally xrn gives me a "possible mail alias loop" and barfs when I post to comp.unix.questions. Why only this group, I cannot tell. I would like to have under Unix the capability I have with the VMS SEARCH utility to display a window of (m,n) lines around the line(s) containing the search string found in the file. I have yet to find a way of doing it with awk, more, sed, or *grep. Any solutions? I don't mind a long command (I can alias it) or even a shell script (I suppose there will be the obligatory 1-line solution in perl :-)) but I don't want a program; I want something that uses utilities that come with all flavors of Unix (okay, exception made for perl). -- This is news. This is your | Peter Scott, NASA/JPL/Caltech brain on news. Any questions? | (pjs@aristotle.jpl.nasa.gov)