Hacker News new | ask | show | jobs
by aeosynth 3403 days ago
Not covered in the article, but `rename` is a multi-file renamer. I wrote a script which used an `echo $f | sed | mv` loop before I learned about this.
2 comments

Be careful there's at least two implementations of rename in different Linux distros. I've run into one made in perl that uses regex in Debian (e.g. `rename 's/foo/bar/' * `). And another one that uses simple strings (`rename foo bar * `) in CentOS.
Indeed. The Perl `rename` is based on the module [File::Rename](http://search.cpan.org/~rmbarker/File-Rename-0.20/).

This name clash makes that the perl module cannot be easily used on CentOS, since the CentOS utility is required for building RPM packages.

You'd have to edit Makefile.PL of the Perl module before installation, to avoid that clash. (I'd prefer to keep the name as "rename.pl", in this case; though file-rename, as on Windows, would work too.)

I use moreutils' vidir for renaming, I don't know rename though.