Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 (USS@Tek, v1.0) based on 4.3bsd-beta 6/6/85; site tektools.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!pyramid!hplabs!tektronix!tektools!marka From: marka@tektools.UUCP (Mark Adams) Newsgroups: net.micro.pc Subject: SEARCH shell script for IBM-PC MS-DOS 3.1 Message-ID: <698@tektools.UUCP> Date: Tue, 28-Jan-86 12:45:31 EST Article-I.D.: tektools.698 Posted: Tue Jan 28 12:45:31 1986 Date-Received: Sat, 1-Feb-86 02:10:01 EST Organization: Tektronix, Inc., Beaverton, OR Lines: 62 Keywords: IBM-PC Search Shell [For the Pac-Man] This is a small shell script I wrote and use quite often on my IBM-AT running MS-DOS 3.1. It does a search of one or more source files in the current directory path for a given one word string, much like the VMS search does. For example, you may want to search a file called "Sample.c" for the string "getchar" : C> search sample.c getchar A much better example is to search all of your source files for a particular string, using wildcard expansion for the filename or the extension. For example, you may want to search all files ending in ".c" for the string "getchar" : C> search *.c getchar I have the output directed to a file called "s.fnd" in my "\bin" directory, and then to the screen. That way, if I miss something, I can easily type out all the found strings again, without having to do the actual search again. This script may be copied, modified, etc., without my permission. Mark Adams Jan. 28, 1986 Tektronix, Inc. Beaverton, OR 97077 tektronix!tektools!marka To use, remove all text to and including the --Cut Here-- lines, and save into a file called SEARCH.BAT. Then place it into a directory where your system path can find it, i.e., "\bin". ----------Cut Here----------Cut Here----------Cut Here----------Cut Here------ rem Shell script SEARCH.BAT rem Usage: C> search sample.ext string - OR - C> search *.ext string rem Written by: Mark J. Adams Jan. 28, 1986 rem Permission to copy, modify, etc., by the author - MJA rem echo off echo SEARCHING FILE(S): "%1" FOR STRING: "%2" if exist c:\bin\s.fnd del c:\bin\s.fnd if not exist c:%1 goto abc for %%f in (%1) do find /n "%2" %%f >> c:\bin\s.fnd echo This file is called "s.fnd" in the \bin directory. >> c:\bin\s.fnd cls echo on more < c:\bin\s.fnd echo off goto def :abc echo FILE(S): "%1" - NOT FOUND :def echo on -----------