Thanks for offering that, Flemming. Modifying the original script per your
directions does, indeed, seem to get rid of the other extraneous
characters. I ran it in a test directory, and the results seem to get just
what I was hoping for. I think I'll go ahead and run it in the real
directory now, where I have probably a couple hundred files in need of
renaming. Great work!
Thanks, James
On Fri, 15 Apr 2005, Flemming Greve Skovengaard wrote:
This should remove the characters in question.
Replace the if-statement with this on:
if ($new_name =~ m/(?:^[-+]|[^-\w.])/ ) {
and add this line below the other $new_name... lines:
$new_name =~ s/[^-\w.]//g;
I have only tested this very little, but the corrections removes anything
that is not a hyphen (-), a word character (A-Za-z_) or a period (.).
--
Flemming Greve Skovengaard FAITH, n.
a.k.a Greven, TuxPower Belief without evidence in what is
told
<[EMAIL PROTECTED]> by one who speaks without knowledge,
4112.38 BogoMIPS of things without parallel.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs