[nflug] file name extensions

Robert Meyer meyer_rm at yahoo.com
Thu Nov 16 19:18:00 EST 2006


Now you gotta remember that some of us have been around since before you were born.  In the days before fire, there was no 'rename' command.  In fact, 'rename' doesn't exist on most Unix systems at all.  It's a linuxism that doesn't translate elsewhere.  Remember, in Unix/Linux, if you can't think of at least three ways to do something, you're not thinking hard enough.

I deliberately submitted my version as a looped shell script 'cuz that was the first thing I thought of.  I thought of the find, second.  I thought of a way to do it with find and perl, too.  In fact, the find/perl solution would be even faster 'cuz you wouldn't have to keep invoking 'mv' for each file.  I remember a way of deleting all files of a certain criteria with something like:
find directory -name '*.bak' -depth -print | perl -ne 'chop;unlink'

Much faster than:
find directory -name '*.bak' -exec /bin/rm '{}' ';'

Cheers!

Bob

----- Original Message ----
From: Jesse Jarzynka <denisesballs at thecybersource.com>
To: nflug at nflug.org
Sent: Thursday, November 16, 2006 6:22:25 PM
Subject: Re: [nflug] file name extensions

Hasn't anyone ever heard of rename???

$ rename -s/.whatever/.sxw/ *

-Jesse
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug





_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list