/ Published in: Perl
Expand |
Embed | Plain Text
#! /usr/bin/perl -w use strict; use File::Copy; foreach my $mp3file (@ARGV) { my $oldname = $mp3file; $mp3file=~ s/(.{0,27}).*(.mp3)/$1$2/; if ($oldname eq $mp3file) { print "Skipping $oldname: name is OK for Mac.\n"; next; } }
Comments
Subscribe to comments
You need to login to post a comment.

This is an approach to do the same thing in ZSH: for foo in *; [[ $#foo -gt 31 ]] && mv "$foo" "${${foo:r}[1,27]}.${foo:e}"