X-NEWS: wkuvx1 comp.os.vms: 1901 Relay-Version: VMS News - V6.0-3 14/03/90 VAX/VMS V5.4; site wkuvx1.bitnet Path: wkuvx1.bitnet!vlsi!ukma!widener!iggy.GW.Vitalink.COM!lll-winken!sun-barr!ccut!wnoc-tyo-news!sranha!anprda!akira Newsgroups: comp.os.vms Subject: Re: How about SEARCH on U**x Message-ID: <1683@anprda.atson.asahi-np.co.jp> From: akira@atson.asahi-np.co.jp (Akira Takiguchi) Date: 17 Sep 91 05:13:12 GMT Reply-To: akira@necom830.cc.titech.ac.jp References: <9109121805.AA18665@ucbvax.Berkeley.EDU> Organization: ATSON, Inc. (a subsidiary of the Asahi Shimbun) Lines: 44 In article <9109121805.AA18665@ucbvax.Berkeley.EDU> SKELTON@vax.lse.ac.uk writes: >We've had some discussion about grep for VMS, but no-one has mentioned what >I miss on U**x, which is SEARCH. I'm asking here because only a hardened VMS >user would dare to suggest that SEARCH might be better than grep :-) GNU egrep from Free Software Foundation, which I believe is ported to VMS as well as unix, can satisfy most things from your wishlist. >What I particulary miss is the /WINDOW qualifier egrep -A -B files ... prints num lines After and Before matching line. or more simply: egrep -C files >, and then in order of >importance (to me) /MATCH (especially /MATCH=NAND), Regexp used in egrep enables you to say: egrep 'A|B|C' files ... A or B or C. egrep -v 'A|B|C' files ... this is your favorite /MATCH=NAND. >/NOEXACT, egrep -i files >/REMAINING This, sed or awk can do better. For example, with sed: sed -n -e '/regexp/,$p' file >and /FORMAT. You should write a simple script with sed. Perl (is also distributed freely under GPL license; see comp.lang.perl) is better, because it can handle any binary file, which no grep nor sed can handle. -- Akira Takiguchi at ATSON, Inc. (a subsidiary of the Asahi Shimbun) WAKO GINZA bldg. 8-10-4 Ginza Chuo-ku Tokyo 104 Japan +81 3 3289 7051(voice) 7066(fax) EMAIL TO