Skip to content

Instantly share code, notes, and snippets.

@kurtroberts
Created December 24, 2013 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurtroberts/8117132 to your computer and use it in GitHub Desktop.
Save kurtroberts/8117132 to your computer and use it in GitHub Desktop.
For when sloppy coders can't keep their case straight. I never believed this possible, but after contracting with a firm who's name I will not mention for a team, I got back about 200 json files with randomly capitalized names. Despite being very clear we were deploying to an apache2 server on Linux, they tested on their case-insensitive Windows…
#!/usr/bin/perl -w
opendir DIR, ".";
my @files = grep { $_ ne '.' && $_ ne '..' } readdir DIR;
closedir DIR;
for $file (@files) {
my $lfile = lc($file);
if ($lfile ne $file) {
print $file . "\n";
`svn mv $file $lfile`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment