home *** CD-ROM | disk | FTP | other *** search
- /** alter.rexx
- *
- * This function edits all the files containing one or more occurrences
- * of a search string and sets the editor in searc/replace mode using a
- * replacement string.
- *
- **/
- parse arg fn ss rs .
-
- options prompt "Next? "
-
- if rs = "" then do
- say "Usage: alter <wildcards> <search string> <replace string>"
- exit
- end
-
- if ~show('l','rexxarplib.library') then addrexxlib
-
- 'search 'fn' 'ss' quiet | execio stem files.'
-
- do i = 1 to files.0
- if files.i = "" then leave
-
- if i ~= 1 then do
- parse pull yesno
- if left(yesno, 1) = 'n' then do
- say "Aborted"
- exit
- end
- end
-
- call setenv('Search', ss)
- call setenv('Replace', rs)
-
- 'e 'files.i' startup alter.txed sticky'
- end
-
- say "Done"
-
- exit
-