#!/bin/bash

HypExpPath="$PWD"
MapleDir=$HypExpPath/"MapleLibs"
LibDir=`find $HypExpPath -name "[0-9]*" -printf "%f "`
echo "****************************************"
[ -e $MapleDir ] || mkdir $MapleDir

echo This will convert the HypExp libraries into a Maple readable format...
echo
for order in $LibDir
do 
echo "Converting files from $HypExpPath/$order ..."  
find $HypExpPath/$order -name "hypexp*.m" -printf "echo -ne \r \"                                         \"                             ;echo -ne \rconverting: %f ;sed -f MathematicaToMaple.sed %p > $MapleDir/%faple ;\n"  > conversion.list 

echo 
source conversion.list
echo  -ne "\r Done                                    "
echo
echo
done
echo " ******** Conversion completed ********"
