I've been attempting to create a simple data entry script through vi editor. I'm not having much luck with it. I"m looking at an example from a book, and they use about 7 entries and I only want to do 3 and I thought it would be the same, just cutting everything down.
I haven't had any luck so far. I don't have any errors when I execute the script, but the cursos is not in the correct position and it doesn't save any entry. Here is the script I'm trying to run, can anyone help me out or tell me what I'm doing wrong????
trap "rm ~/tmp/* 2> /dev/null; exit" 0 1 2 3
musicfile=~/music/music_database
looptest=y
while [ $looptest = y ]
do
clear
tput cup 1 4; echo "Linux Music Database Additions"
tput cup 2 4; echo "=============================="
tput cup 4 4; echo "Title : "
tput cup 5 4; echo "Artist: "
tput cup 6 4; echo "Album: "
tput cup 8 4; echo "Add Another? (y)es or (q)uit: "
tput cup 9 18; read newalbum
if [ "$newalbum" = "q" ]
then
clear; exit
fi
tput cup 5 18; read title
tput cup 6 18; read artist
tput cup 7 18; read album
# Check to see if album is not a blank before you write to disk
if [ "$album" > " " ]
then
echo "$title:$artist:$album" >> $musicfile
fi
tput cup 12 33; read looptest
if [ "$looptest" = "q" ]
then
clear; exit
fi
done