*********************************************************************************************
#!/bin/bash
#---------------------------------------------------------------------------
# Title: mp3con
# POC: Glenn Harrison
# Date Created: 11/18/2005
# Purpose: MP3 Folder and File name cleansing
# Called By: $USER
# Dependencies: awk, sed
#---------------------------------------------------------------------------
mp3()
{
echo Removing non-compliant files.
rm *.db
rm *.m3u #This line can be removed. I don't use the m3u file.
rm *.jpg
for song in *
do
{
#
# Convert song from <Band> - <Track Num.> - <Song>
# To <Compliant Track Num.> - <Song>
#
newSong=`ls "$song"|awk -F '-' '{print $2"-"$3}'|sed 's/ //'`
mod_song=0$newSong
echo Renaming "$song" to "$mod_song"
cp "$song" "$PWD"/"$mod_song"
{
if [ -e "$mod_song"]
then
{
if [ "$song" != "$mod_song" ]
then rm "$song"
else echo FILE NAME CONVERSION FAILED!!!
fi
}
else echo FILE NAME CONVERSION FAILED!!!
fi
}
}
done
cd ..
}
directory()
{
for folder in *
do
{
#
# Convert folder from <Band> - <Year> - <Album>
# To <Band> - <Album>
#
newDir=`echo "$folder"|awk -F '-' '{print $1"-"$3}'`
echo $newDir
cp -R "$folder" "$PWD"/"$newDir"
{
if [ -d "$newDir" ]
then
{
if [ "$folder" != "$newDir" ]
then rm -R "$folder"
else echo FOLDER NAME CONVERSION FAILED!!!
fi
}
else echo FOLDER NAME CONVERSION FAILED!!!
fi
}
cd "$newDir"
mp3
}
done
}
pathDirectory()
{
tempDir=$PWD
cd "$mp3Path"
directory
cd "$tempDir"
}
location()
{
echo "Select from the following options:"
echo "1. Modify MP3 file(s) in currrent directory."
echo "2. Modify Folder(s) and its contents in current directory."
echo "3. Specify path to MP3 directory and modify its contents."
read selection
if [ "$selection" = 1 ]
then mp3
elif [ "$selection" = 2 ]
then directory
elif [ "$selection" = 3 ]
then echo "Specify full path to MP3 folder."
read mp3Path
pathDirectory
else echo "Invalid selection. Try again."; location
fi
}
location
*********************************************************************************************









it is really appreciating...!!
take care
How are you?
--
--
[link]
--
[link]
1- You can hug the person who hugged you!
2- You can't hug the person more than 2 times
3- You -MUST- hug at least 6 other people
4- You should hug them in public! Paste it on their user page! c'mon... don't be scared of public displays of affection
5- Random hugs are perfectly okay! (and sweet)
6- You should most definitely get started hugging right away!
--
--
N3bulA = Alien
--
--
Fazer Fotografia é Escrever Poesia com a Luz .. ou de ver gajas nuas..
Making Photography is Writing Poetry with Light.. and seeing naked chicks..
Marco Matos
--
Previous Page12345...Next Page