in reply to Re: Word Replacing
in thread Word Replacing
perl -pi.orig -e 's/original/substitute/g' <filename>
(To the OP:) if you want that to apply to a large number of files, all in the same directory, just give them on the cmd line. That is, <filename> can really be <filenames> or a shell pattern that the shell will expand. If the files are too many for the shell to handle, then as I wrote in my other reply do so yourself with glob:
perl -pi.orig -e 'BEGIN{@ARGV=map glob, @ARGV} s/original/substitute/g +' '*.foo' 'bar.*'
Note that this is also necessary under Windows, where the shell does not do expansions at all. But in that case you have to use double quotes instead of single ones.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |