[Linux-disciples] Troubles with 'rename'

Stephen R Laniel steve at laniels.org
Tue Jun 21 16:14:58 EDT 2005


On Tue, Jun 21, 2005 at 04:08:27PM -0400, Adam Rosi-Kessel wrote:
> Well, my script works. :)

Granted. I just want to understand why 'find' and 'rename'
don't behave the way I expect them to.

> Hm, I'm not sure you can still guarantee that this will do things in the
> right order. It also is going to run rename many more times than
> necessary, since it will run it on each file. I can almost guarantee
> that my script will be faster than your attempted find command on a
> large directory tree.

Your script's trick is to run the rename command once, on
all the files within a given directory. I doubt it would be
so hard to do this with 'find'. Though I'm curious. Once I
get the find approach working, I'll do a test. If there's
any performance hit from your script, it's that it's calling
'lr' recursively, which may lead to a blown stack. But
that's probably not a huge concern.

I realize this may be giving too much to stylistic purity,
but I hope to learn something from it.

-- 
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20050621/6ad83c63/attachment.pgp


More information about the Linux-disciples mailing list