Not sure why the author did not use zmv -W '**.js' '**.ts' as it would seem to show his point more strongly. (All that 29 vs 56 accounting is a bit fishy anyway, though. He counts the 3 “ -n” against himself and a trailing semi-colon against his competition and uses file where f would have sufficed and Zsh short loops could have gotten it down as well, plus 29/56 = 51.8% which means his “Besides saving” should really be “Besides being” and he rounded unusually.)
It’s quite similar to Perl rename script. In Debian packaged as
prename
.…likely so as not to conflict with the very similar
rename
command in the util-linux package (which I use pretty often, personally): https://github.com/util-linux/util-linux/blob/master/misc-utils/rename.cYour mileage may vary, but if you like the original, you will probably like another Perl script with the same name by Aristotle Pagaltzis even more.
Great article! I wonder how you discover zsh modules like this.
Not sure why the author did not use
zmv -W '**.js' '**.ts'
as it would seem to show his point more strongly. (All that 29 vs 56 accounting is a bit fishy anyway, though. He counts the 3 “ -n” against himself and a trailing semi-colon against his competition and usesfile
wheref
would have sufficed and Zsh short loops could have gotten it down as well, plus 29/56 = 51.8% which means his “Besides saving” should really be “Besides being” and he rounded unusually.)That’s awesome, thanks for sharing!