Path: utzoo!attcan!uunet!mcvax!ukc!warwick!maujd From: maujd@warwick.UUCP (Geoff Rimmer) Newsgroups: comp.unix.questions Subject: Re: grep replacement Message-ID: <691@ubu.warwick.UUCP> Date: 9 Jun 88 18:46:10 GMT References: <7882@alice.UUCP> <2450011@hpsal2.HP.COM> Sender: news@warwick.UUCP Reply-To: maujd@warwick.UUCP (Geoff Rimmer) Followup-To: morrell@hpsal2.HP.COM Organization: Computer Science, Warwick University, UK Lines: 13 In article <2450011@hpsal2.HP.COM> morrell@hpsal2.HP.COM (Michael Morrell) writes: >grep -n does this, but I'd like to see an option which ONLY prints the line >numbers where the pattern was found. How about grep -n pattern file | sed "s/:.*//" ? ------------------------------------------------------------ Geoff Rimmer, Computer Science, Warwick University, UK. maujd@uk.ac.warwick.opal ------------------------------------------------------------