I am trying to automate my edit-many-files work here with perl, maybe with the dos command line. I don't need backup files because I have everything under version control already.
First question is, can I get this working a slick one liner from dos (mainly for perl missionizing around the office :) ). Second is, if there's a way to do this without a backup file?
The usual tactic for inplace many files is the "perl dash pie" trick, perl -p -i -e "s/change this/to this/g" *, but this appears to be only for nix. I haven't been able to get * to work as "all files" from the dos command line. Is there a way to get this to work as a one-liner from dos?
Abandoning the one liner idea for the time being, I found
two very helpful merlyn posts at My pattern for "in-place edit" for many files and Shell trick to edit many files with perl (in reply to another post). Like the perl pie trick though, these leave backup files.
Any way to adopt the above scripts without leaving those .bak breadcrumbs?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.