There probabley is a better way, if you know one please email zgornz at yahoo.com, i'm still learning perl and i would like any feedback.#!/usr/bin/perl -w #Rename's files to remove spaces and other shitz @names = qx {ls}; $a = qx {pwd}; @band = split(/\//, $a); $band[2] =~ s/\_//; chomp $band[2]; print "$band[2]\n"; foreach $file (@names) { chomp $file; $new = $file; $new =~ s/\.mp3//; $new =~ s/\W//g; $new =~ s/\_//g; $new =~ s/$band[2]//gi; if ( $file !~ "$band[2]\_$new\.mp3") { print "\tRenaming $file to $band[2]\_$new.mp3\n"; qx {mv \"$file\" "$band[2]\_$new\.mp3"}; } else { print "\tNo Change for $file\n"; } }
In reply to Mp3Mat by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |