Re: one liner for replacing under Windows?

[email protected] ("Xavier Noria")
Newsgroups perl.beginners
Message-ID <[email protected]>
On Sat, Jun 14, 2008 at 9:56 AM, Octavian Rasnita <[email protected]> wrote:

> Is there a one-liner command that can replace a certain text with another in
> more files specified with wildcards like *.html that works under Windows
> cmd?

Since you ask this you probably know the Windows shell does not expand
wildcards. There's a trick for Perl one-liners though (untested):

  perl -e "@ARGV = glob(qq($ARGV[0])); s/foo/bar/ while <>" *.html

You see the idea.

-- fxn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.