Lewis' Blog Tales from the trenches of information technology

14Feb/100

Mass renaming files at the OS/2 command line

An interesting head scratcher to which I have been returning almost monthly for some time is the distinct lack of ability to rename files based upon a mask at the OS/2 command line (in a minute, I'll explain why this is a fairly regular occurrence). Of course, OS/2's cmd.exe is not alone in that regard; DOS' COMMAND.COM, 4DOS, 4OS2, JdeBP's 32-bit CMD, Windows' CMD, and even the *nix shells with which I'm familiar don't naturally lend themselves to this kind of flexibility (okay, I lied: you can do it with Bash, of course; see below).

Why a monthly occurrence?

I don't normally send paper invoices to clients anymore. Not only does it kill more trees than it's worth (and no, I'm not an environmental zealot; we grow new trees every day - I'm just the guy who has to buy the paper and the laser toner), but the postage has over the years become a major factor in this decision. Anyone who has to regularly bill clients for outstanding balances knows from whence I speak; send the same client a dunning notice for six months, and that $150 bill has just been whittled down to $147.36 ($0.44 * 6 = $2.64; $150 - $2.64 = $147.36). This just adds the insult to the injury.