export EPSRroot=/home/aks45/testepsr/EPSR26distribution/EPSR
export EPSRbin="$EPSRroot"'/bin'
export EPSRstartup="$EPSRroot"'/startup'
EPSRrun=$(pwd)
if [ $# -gt 0 ]
then 
  EPSRrun=$1 ;
fi
# Check if the specified folder exists. If not create it in the current folder.
if [ ! -d "$EPSRrun" ]
then EPSRrun=$(pwd)/"$EPSRrun";
fi
#echo "$EPSRrun" 
# Check if the specified folder exists. If not create it.
if [ ! -d "$EPSRrun" ]
then mkdir "$EPSRrun"
fi
cd "$EPSRrun"
# Copy the EPSR startup file 
if [ ! -f "epsr26" ]
then
cp "$EPSRroot"/epsr26 epsr26
chmod +x epsr26
fi
# Check that the specified folder has plot_defaults.txt. If not then copy a version in.
if [ ! -f plot_defaults.txt ]
then cp "$EPSRstartup"/plot_defaults.txt plot_defaults.txt
fi
cp "$EPSRstartup"/system_commands_linux.txt system_commands.txt
cp "$EPSRstartup"/gnuatoms.txt gnuatoms.txt
cp "$EPSRstartup"/gnubonds.txt gnubonds.txt
cp "$EPSRstartup"/f0_WaasKirf.dat f0_WaasKirf.dat
cp "$EPSRstartup"/vanderWaalsRadii.txt vanderWaalsRadii.txt
"$EPSRbin"/epsrshell

