Voder-Vocoder

The Log of Hal Canary

Navigation: Home | THE LOG | Log Archives | Resume | Contact Info | Public Key | SSL | Math Applets | Site Map | WP Backend | RSS2 | Atom

« Photos | Dreams »

despaceify script

It now gets rid of apostrophies as well as spaces. It will then convert to lowercase unless it is a directory.

#!/usr/bin/perl
## ~/bin/despaceify ##
#DTPD#
foreach my $file (glob "*") {
  my $new = $file;
  $new =~ s/ /_/g;
  $new =~ s/\'//g;
  $new =~ tr/A-Z/a-z/
    if (system "test -d \"$file\"");
  system "mv -vi \"$file\" $new"
    if ($new ne $file);
}

Hal Canary | Computers & Code | 2003-07-19 03:50:10 EDT
Permanent Link | No Comments

Comments are closed.

Copyright 1997-2007 by Hal Canary.
mailto: h3 at halcanary dot org
xmpp:halcanary@jabber.org
aim:halwcanary
http://halcanary.org