home *** CD-ROM | disk | FTP | other *** search
-
-
- R U N @ 1.0
- ============
-
-
- Free Software by TapirSoft Gisbert W.Selke
-
- As per a user's request, this is a utility that executes a command once
- for each file included in a list of files.
-
- The file list is read from StdIn and must contain one file name per
- line. The RUN@ call must include, on the command line, a command
- pattern, included in quotes, with a substitution marker, ^, somewhere.
- This marker is substituted by each file name in turn, and the resulting
- lines are written to a temporary batch file, normally RUN@@.BAT, which
- is executed once all the file names have been processed. This batch file
- destroys itself after execution.
-
- Suppose a file called f.lst contains the following lines:
-
- foo.bar
- oofa.c
- kermit.hlp
-
- Then calling
-
- run@ < f.lst "type ^"
-
- will produce a batch file with the contents
-
- type foo.bar
- type oofa.c
- type kermit.hlp
- del RUN@@.BAT
-
- Alternatively, under DOS 5.0 and later, you could use a pipe as in
-
- dir /b | run@ "type ^"
-
- (Incidentally, the /b switch to the DIR command is essential in this
- example; however, it's a DIR feature new to DOS 5.0.)
-
- That's basic operation; now, here are the frills:
-
- You can specify one or more of the following command line switches which
- change RUN@'s behaviour:
-
- The /m switch requests manual execution. Normally, the resulting batch
- file is created, executed, and deleted, so that you never get to see it.
- In certain cases, you will want to execute it by hand; in particular, if
- the command to be executed installs a TSR part, like DOS PRINT does when
- called for the first time, or whenever the DOS environment is about to
- be changed. Using the /m switch prevents automatic execution; you have
- to execute the batch file yourself by invoking it at the command line.
- Note that the very last thing that the batch file does is to destroy
- itself; if you want to keep it, specify the /k option, which is
- independent of the use of /m. Examples:
-
- run@ < f.lst "print ^" /m
- run@ < f.lst "attrib +r ^" /k
- run@ < f.lst "attrib +r ^" /k
-
- Normally, the batch file echoes all its commands; if you want it to
- execute quietly, use the /q switch.
-
- If, for some reason, you want a file name other than RUN@@.BAT for the
- resulting file, you can specify it with the /f switch, directly followed
- by the file name you want, with no intervening spaces. The .BAT
- extension is added automatically, unless the name you gave already
- includes a period. Example:
-
- run@ < f.lst "more < ^" /fmoron
-
- will create a batch file named MORON.BAT. By the way, if you include one
- of the /k, /m, or /f options, any existing file of the same name is
- overwritten mercilessly (unless write-protected, in which case an error
- occurs). With the no-frills call described in the beginning, RUN@ takes
- care not to overwrite any existing files.
-
- Finally, if you don't like the substitution marker, ^, e.g., because it
- conflicts with your CED, you can specify a different one with the /s
- switch, where the desired marker must follow immediately after the /s.
- Example:
-
- run@ < f.lst "attrib +r #" /s#
-
- will work on CED-equipped systems, too.
-
- You can use either single or double quotes; you cannot include the quote
- character you chose within the string itself.
-
- Here, finally, are two more examples of RUN@ usage:
-
- dir /b /s | run@ "del ^" /m
-
- will create a batch file RUN@@.BAT which, when run, will delete all
- files in the current directory and all its sub-directories (DOS 5.0 and
- later only). Use at your own risk!
-
- Suppose, then, we have a file named CHI.X:
-
- Marilyn
- Mae
- Marlene
- Raquel
- Brigitte
- Claudia
- Gina
- Fanny
-
- then the command
-
- sort < chi.x | run@ "^ darling, wish you were here, oh sweet ^!" /k/m/fadore.txt
-
- will produce a file ADORE.TXT with the contents:
-
- Brigitte darling, wish you were here, oh sweet Brigitte!
- Claudia darling, wish you were here, oh sweet Claudia!
- Fanny darling, wish you were here, oh sweet Fanny!
- Gina darling, wish you were here, oh sweet Gina!
- Mae darling, wish you were here, oh sweet Mae!
- Marilyn darling, wish you were here, oh sweet Marilyn!
- Marlene darling, wish you were here, oh sweet Marlene!
- Raquel darling, wish you were here, oh sweet Raquel!
-
- The usual disclaimers apply:
-
- This is free software, meaning you can use and copy it as you please,
- but don't sell it coz I retain the copyright. It comes without any
- guarantees whatsoever, and I can't be held responsible for anything I do
- or may have done. If it doesn't work as advertised, let me know at the
- address given below; if you need more functionality, however, I'd
- recommend you write a wee AWK programme to do all the pattern processing
- or whatnot that you need. Gnu AWK and other implementations for MS DOS
- are available from many fine software places for free.
-
- CED is a fine piece of software copyrighted by Chris Dunford of the Cove
- Software Group, as far as I know.
-
- Gisbert W.Selke
- Ermekeilstraße 28
- D-5300 Bonn 1
- Germany
- <S00100@DBNRHRZ1.BITNET>
-
-