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 $1/config JavaSTICS-1.5.1-STICS-10.0.0 &&
unzip $2 -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 $3 -d TMPbis &&
mv TMPbis/*/* JavaSTICS-1.5.1-STICS-10.0.0/WS &&
cp $4 JavaSTICS-1.5.1-STICS-10.0.0/WS/USMs.csv &&
cp $5 JavaSTICS-1.5.1-STICS-10.0.0/WS/Tec.csv &&
cp $6 JavaSTICS-1.5.1-STICS-10.0.0/WS/Ini.csv &&
cp $7 JavaSTICS-1.5.1-STICS-10.0.0/WS/Station.csv &&
cd JavaSTICS-1.5.1-STICS-10.0.0 &&
Rscript --verbose $1/redelacSticsInputGenerator.R &&
rm WS/1* &&
mv WS $WSname &&
zip -r $WSname $WSname &&
cp $WSname.zip $8
