in reply to Inplace editing, dos one liner, without a backup file?

This came up the other week. It's basically a limitation of Windows (SURPRISE!) that Perl has to make a named backup file. See One-liner: -i without .bak?.

--
We're looking for people in ATL

  • Comment on Re: Inplace editing, one liner, without a backup file?

Replies are listed 'Best First'.
Re^2: Inplace editing, one liner, without a backup file?
by tphyahoo (Vicar) on Aug 09, 2005 at 12:46 UTC
    Thanks fletch. From reading the post you linked to, I also conclude that in place edit on multiple files with the "perl pie trick" works better from the cygwin command line than from the dos command line, where I get
    C:\thomasdata\thomasprojects\fixHtml\t\structural\beginning_includes>p +erl -p -i -e "s/this/that/" *.* Can't open *.*: Invalid argument.
    Well, one more reason to install cygwin I suppose, something I've been meaning to toy with for awhile. But even with cygwin, you automagically get .bak no matter what, if I understood that thread correctly.
      workaround:
      for %f in (*.*) do perl -pi.bak -e "s/this/that/" %f & del %f.bak


      holli, /regexed monk/