I just cut a new release of rename: 1.600. The headline feature of this version was inspired by Dr. Drang: a built-in
$N variable for easily numbering files while renaming them. It is accompanied by a
--counter-format switch for passing a template, so you will be spared the fiddling with
sprintf for padded counters.
I also finally gave the documentation the huge overhaul it has needed and deserved for a long time. There is now a proper synopsis, the description is brief, and the tutorial that was previously in the description section is a separate much larger section adapted to all the new stuff added since my original version of this utility. Lots of things are now documented properly for the first time.
In more minor notes, there is now a negatable
--stdin switch you can use to explicitly tell
rename to read from stdin, rather than it just guessing that it’s supposed to do that based on the absence of file names on the command line. The purpose of this is more predictable behaviour in situations where
rename is passed computed arguments that may evaluate to nothing (e.g. with the
nullglob shell option).
And lastly, I extracted a new
--trim switch from
--sanitize, mostly for consistency’s sake.