I used to use the Sing that iTune! widget to insert lyrics into iTunes, but moved to using pearLyrics to avoid a bug. (The bug was that occasionally the lyrics for one song would be put into the iTunes lyrics for a different song).
However, Sing that iTune! also saves lyrics as text files, but names them differently from pearLyrics. So I wrote a UNIX shell script to copy the files and rename them in pearLyrics format. This allows all the lyrics files to be kept together the same way. I thought someone who is learning about shell scripts might want to see it.
The script is:
#
# copy all "Sing that iTune!" song files to a directory with
# the song filename in pearLyrics format
#
# a directory called sing2pearfiles is created on the desktop
# to hold the output files, if required.
#
mkdir -p ~/Desktop/sing2pearfiles;
cd ~/Documents/Sing that iTune!/
find . -type f -name *.txt -exec sh -c 'oldname="{}"; newname=$(echo "${oldname#./}" | tr "[:upper:]" "[:lower:]" | tr "/" " "); cp "$oldname" ~/Desktop/sing2pearfiles/"$newname"' ;
mkdir -p ~/Desktop/sing2pearfiles
Firstly the sing2pearfiles folder is created if it doesn't already exist.cd ~/Documents/Sing that iTune!/
find . -type f -name *.txt
Then the "Sing that iTune!" lyrics folder is searched for files with names that end with ".txt" using.-exec sh -c
For each of the files a shell script is run.oldname="{}"; newname=$(echo "${oldname#./}"
The names of these files are manipulated to remove "./" from the start.tr "[:upper:]" "[:lower:]"
Any uppercase letters are turned into lowercase.tr "/" " "
The directory separator character "/" is turned into a space.cp "$oldname" ~/Desktop/sing2pearfiles/"$newname"'
Finally the file is copied.Mac OS X Hints
http://hints.macworld.com/article.php?story=20051126123700103