cp -r /home/rstudio/JavaSTICS-1.5.1-STICS-10.0.0 . &&
/usr/bin/time -p -o ./bashlog unzip -qq $5 -d TMP &&
echo "Step 0, time to unzip the Workspace:" &&
echo "====================================" && 
cat ./bashlog &&
echo "====================================" && 
export WSname=$(ls TMP) &&
mv TMP/* JavaSTICS-1.5.1-STICS-10.0.0/WS &&
cp $6 JavaSTICS-1.5.1-STICS-10.0.0/WS/successionPlan.csv &&
cd JavaSTICS-1.5.1-STICS-10.0.0 &&
/usr/bin/time -p -o ./bashlog Rscript --verbose $4/redelacSticsSimulator.R $1 $2 $3 &&
echo "Step 1, time to run the R script:" &&
echo "=================================" && 
cat ./bashlog &&
echo "=================================" && 
cd WS &&
/usr/bin/time -p -o ./bashlog zip $9 -qq -r analyse_simulations_STICS analyse_simulations_STICS &&
echo "Step 2, time to zip the results:" &&
echo "================================" && 
cat ./bashlog &&
echo "================================" && 
cp analyse_simulations_STICS.zip $8 &&
rm -rf analyse_simulations_STICS &&
cd .. &&
mv WS $WSname &&
/usr/bin/time -p -o ./bashlog zip $9 -qq -r $WSname $WSname &&
echo "Step 3, time to zip the Workspace:" &&
echo "==================================" && 
cat ./bashlog &&
echo "==================================" && 
cp $WSname.zip $7
