- All of which brings my to my tired question (revised a little each time). And I ask again because this part is still not clear. Assuming that the files are already backed up, does not this simple line:
%perl -pie 's/old/new/g' ./*/*
It comes close ... what this line does not do is act on the files of the sub-directories of your sub-directories. Wih your original method, files in the current directory and its immediate subdirectories are being acted upon, but no further. No files in subdirectories therein would be acted upon, negating the 'all sub-directories' requirement of your one-liner. Depending on your directory structure, this could leave a
large number of files untouched.
The best way to describe this is through example. From the
/usr directory of my mail server:
budapest:/usr# ls -l ./*/* | wc -l
4505
budapest:/usr# find . -type f -print | wc -l
22838
The difference in number of files is quite apparent - If however, you have no further subdirectories beneath those of your current directory, then there should be no problems, but if there is, potentially a large number of files could be missed.
Ooohhh, Rob no beer function well without!
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.