cp -r /home/rstudio/JavaSTICS-1.5.1-STICS-10.0.0/JavaSTICS-1.5.1-STICS-10.0.0 . &&
rm -rf JavaSTICS-1.5.1-STICS-10.0.0/config &&
cp -r $2/config JavaSTICS-1.5.1-STICS-10.0.0 &&
unzip -q $3 -d TMP &&
export WSname=$(ls TMP) &&
mv TMP/* JavaSTICS-1.5.1-STICS-10.0.0/WS &&
cp JavaSTICS-1.5.1-STICS-10.0.0/config/param_gen.xml JavaSTICS-1.5.1-STICS-10.0.0/WS &&
cp JavaSTICS-1.5.1-STICS-10.0.0/config/param_newform.xml JavaSTICS-1.5.1-STICS-10.0.0/WS &&
unzip -q $4 -d TMPbis &&
mv TMPbis/*/* JavaSTICS-1.5.1-STICS-10.0.0/WS &&
cp $5 JavaSTICS-1.5.1-STICS-10.0.0/WS/USMs.csv &&
cp $6 JavaSTICS-1.5.1-STICS-10.0.0/WS/Tec.csv &&
cp $7 JavaSTICS-1.5.1-STICS-10.0.0/WS/Ini.csv &&
cp $8 JavaSTICS-1.5.1-STICS-10.0.0/WS/Station.csv &&
cd JavaSTICS-1.5.1-STICS-10.0.0 &&
Rscript --verbose $2/redelacSticsInputGenerator.R $1 &&
rm WS/1* &&
mv WS $WSname &&
zip -q -r $WSname $WSname &&
cp $WSname.zip $9
