I am writing a simple script to automate my regression testing. I am new to bash scripting and my goal is achieve the most efficient and clean code. I have written a simple function to allow me to select which subject I would like to test. This will loop until I select the exit option. Again, this is quite simple; however I am looking for some feedback on how I can improve.
BIO=biology
showMenu () {
echo "What subject would like to regression test?"
echo "1) Physics"
echo "2) Sociology"
echo "3) Biology"
echo "4) Quit"
}
while [ 0 ]
do
showMenu
read CHOICE
case "$CHOICE" in
"1")
read SUBJECT
SUBJECT=physics
echo "LOG: REGRESSION TESTING $SUBJECT" $SUBJECT
GENERATE_CSS=`lessc /home/developer/oer.exports/css/ccap-$BIO.less > /home/developer/oer.exports/css/ccap-$BIO.css`
echo "LOG: CSS GENERATION COMPLETE"
GENERATE_PDF=`python collectiondbk2pdf.py -v -s ccap-$BIO -d ./test-ccap/col$SUBJECT $SUBJECT.pdf -t tempdir/$SUBJECT`
echo "LOG: GENERATING $SUBJECT PDF WITH $BIO CSS STYLE"
;;
"2")
read SUBJECT
SUBJECT=sociology
echo "LOG: REGRESSION TESTING SOCIOLOGY" $SUBJECT
GENERATE_CSS=`lessc /home/developer/oer.exports/css/ccap-$BIO.less > /home/developer/oer.exports/css/ccap-$BIO.css`
echo "LOG: CSS GENERATION COMPLETE"
GENERATE_PDF=`python collectiondbk2pdf.py -v -s ccap-$BIO -d ./test-ccap/col$SUBJECT $SUBJECT.pdf -t tempdir/$SUBJECT`
echo "LOG: GENERATING $SUBJECT PDF WITH $BIO CSS STYLE"
;;
"3")
echo "Biology"
DIFF=`diffpdf -a --debug=2 /tmp/pdf/diff bio.pdf bio_slicer.pdf`
echo "LOG: DIFF DEV vs STAGING NOW AVAILABLE FOR PDF VIEW. "
;;
"4")
echo "Exiting now..."
exit
;;
esac
done