Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!pantor!richard From: richard@pantor.UUCP (Richard Sargent) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: Looking for a specific utility Message-ID: <20.UUL1.3#5109@pantor.UUCP> Date: 21 Aug 89 17:21:11 GMT References: <6868@rpi.edu> Organization: Pansophic Systems Inc, Graphics Product Company Lines: 32 > From: sdn@anyguay.acm.rpi.edu (Eric Roode) > Message-ID: <6868@rpi.edu> > > In article <1634@bucket.UUCP> leonard@bucket.UUCP (Leonard Erickson) writes: > >pdccs@unix.cis.pittsburgh.edu (Patrick Champion) writes: > > > >< Apply a command line to every file in a directory. > > PC magazine published a utility at least a year ago (I don't remember the > specific issue) called SWEEP that applied a command to the current directory > and to all subdirectories under the current directory. If you can find out > what issue it was, you've got the utility. I have done this regularly from within DOS. Syntax? Try: c> for %f in (*.*) do your_command_line Double the % when used in a batch file. Of course, there are complications if your_command_line creates new files, converts *.old to *.new, you can't substitute alternate file name extensions. In cases like these, I simply use a "new" directory for the output files. Example: c> for %f in (*.old) do sed /this/that/ %f >..\new\%f I hope this helps. Richard Sargent Internet: richard@pantor.UUCP Systems Analyst UUCP: uunet!pantor!richard