Re: The rename command…

Johnny Rosenberg gurus.knugum at gmail.com
Wed Aug 27 19:46:24 UTC 2008


2008/8/27 Rashkae <ubuntu at tigershaunt.com>

> Johnny Rosenberg wrote:
>
> >>
> > When I was searching for a solution to my problem (which I now consider
> > solved) I think I ran into a solution without the rename command… I
> think
> > they used mv instead, but I can't find it.
> >
> > Is there a reason not to use rename (such as it might be slow or
> something,
> > maybe even incompatibility with non-Debian based systems)? I realise that
> I
> > need regular expressions to achieve the name change, which makes rename
> the
> > convenient choice, but there should be other ways, shouldn't it?
> >
> > Unfortunately I never bookmarked the site where I found it (or THINK I
> found
> > it…).
> >
> > J.R.
> >
>
> There is a standard linux rename command.  Unfortunately, Debian
> replaces it with the Perl "prename".  This is problematic because the
> syntax between standard linux rename and prename is very different, and
> therefore you can't write a script with rename that will work with
> default debian distros and other distros.  (you can search this list for
> a recent long discussion I had with myself on the subject of rename)
>
> ps: well, that's not technically true.  You could write a script that
> checks for the appropriate command and sets it as a variable, that would
> work across distors, but I think you get my point.
>
When looking around on the web, I've seen a few sites where they mention the
"other" rename, but no one seems to use it very much. One person even
mentioned it as "pretty useless" or something like that…

I don't know very much about Perl, almost nothing at all, but isn't Perl a
programming language that doesn't use a compiler? Maybe I misunderstood, but
isn't the Perl rename thing written in Perl? If so, shouldn't that mean that
rename is quite a lot slower than it would be if it was written in, for
example, C, like I think the rest of the Unix/GNU/Linux commands are, such
as mv?

That's why I asked for a solution without involving rename at all. Not that
it matters if renaming a few hundred files recursively in a folder with, in
my case about 21500 objects (files, links and folders), but I always think
that if I can make something faster, I should, at least if it doesn't take
too much time… In this case I learn something on the way, which I take as a
valuable bonus.

J.R.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080827/efdc80b4/attachment.html>


More information about the ubuntu-users mailing list