in reply to Re: (tye)Re: Pruning of file with timestamps filenames
in thread Pruning of file with timestamps filenames
Actually, if asked to do this myself, I would use plain old GNU find. [...] but neither have significant advantages over the find utility for this particular question.
Actually, there are several advantages of doing this type of thing with Perl instead of the regular "find" command. First, you can do it all in a single process. Second, you don't have to worry whether your "find" and "xargs" support "-print0" and "-0" nor remember to use them and yet your Perl code will not do dangerous things in the face of files with whitespace in their names. Third, Perl code is easier to extend in interesting ways when the desire hits.
But my point about find2perl is that you can use it to generate the first version of the script and then just update that script in the future. Or use it to generate a template then edit it so that it takes the variable bits from the command line or even prompts for them (this is what I meant about being easy to extend in interesting ways).
- tye (but my friends call me "Tye")
|
|---|