Article View: net.micro.pc
Article #5527Re: SEARCH shell script for IBM-PC MS-DOS 3.1
From: Skip Addison Jr
Date: Thu, 30 Jan 1986 18:02
Date: Thu, 30 Jan 1986 18:02
31 lines
1732 bytes
1732 bytes
In article <698@tektools.UUCP> marka@tektools.UUCP (Mark Adams) writes:
>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" :
> ...
>For example, you may want to search all files ending in ".c" for the string
>"getchar" :
> ...
>Mark Adams Jan. 28, 1986
> ...
What about a simple
for %%i in (%2) do find %1 %%i
and redirect the output wherever you want it. Note the example above would
be in a batch file. I usually just type it out and replace %1 and %2 with
the string and filespec, and remove one of the '%' from "%%i" giving "%i":
for %i in (*.c) do find "stdio.h" %i >>find.out
The ">>" must be used rather than ">" or each find execution will overwrite
the file.
-- Skip Addison
{lll-crg, decwrl, ihnp4}!amdcad!cae780!ubvax!skip
Technical Details
Message-ID:
<419@ubvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!amdcad!cae780!ubvax!skipReferences:
<698@tektools.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site ubvax.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!amdcad!cae780!ubvax!skip From: skip@ubvax.UUCP (Skip Addison Jr) Newsgroups: net.micro.pc Subject: Re: SEARCH shell script for IBM-PC MS-DOS 3.1 Message-ID: <419@ubvax.UUCP> Date: Thu, 30-Jan-86 13:02:11 EST Article-I.D.: ubvax.419 Posted: Thu Jan 30 13:02:11 1986 Date-Received: Sat, 1-Feb-86 20:35:28 EST References: <698@tektools.UUCP> Reply-To: skip@ubvax.UUCP (Skip Addison Jr) Organization: Ungermann-Bass, Inc., Santa Clara, Ca. Lines: 31 Keywords: IBM-PC Search Shell