#!/bin/shset -esubdirs=${1:-"pre_solution1 pre_solution2 pre_solution3 pre_solution4 main_solution1 main_solution2 main_solution3 main_solution4 main_solution5"} for sd in $subdirs; do cd $sd for fl in *.scala; do echo "$sd/$fl" echo "copy to ${sd/solution/templates}/${fl%.scala}.jar" scalac -d ${fl%.scala}.jar $fl cp ${fl%.scala}.jar "../${sd/solution/templates}" hg add "../${sd/solution/templates}/${fl%.scala}.jar" done cd ..donehg commit -m "updated jars"# producing solutions and templates# tar -zxvf templates.tgz pre_templates* main_templates*# tar -zcvf templates.tgz pre_templates* main_templates*