commands to be executed in order for a batch jobs!

Hi All,

I am trying to run this script. I have a small problem:
each "./goada.sh" command when done produces three files (file1, file2, file3) then they are moved to their respective directory as can be seem from this script snippet here.

The script goada.sh sends some commands for some calculations as jobs to a certain system. These jobs run in parallel with each others and produce their outputs to the same directory.

The produced files from each run of "goada.sh" will have the same name and they will be overwritten by each other.

The only thing I could come up with is to look for a command that will make sure that each line of the script will be executed, if and only if the previous command is executed. Is this possible?

#!/bin/sh

./clean.sh

mkdir adabdt/bdt01
mv *.root adabdt/bdt01/
mv *.spr adabdt/bdt01/
mv *.log adabdt/bdt01/

mkdir adabdt/bdt02/
sed -i -e "s/-l 50/-l 100/" adaBDT01.sh
sed -i -e "s/-l 50/-l 100/" adaBDT02.sh
sed -i -e "s/-l 50/-l 100/" adaBDT03.sh
nohup ./goada.sh > anything


./clean.sh
mv *.root adabdt/bdt02/
mv *.spr adabdt/bdt02/
mv *.log adabdt/bdt02/

mkdir adabdt/bdt03/
sed -i -e "s/-l 500/-l 1000/" adaBDT01.sh
sed -i -e "s/-l 500/-l 1000/" adaBDT02.sh
sed -i -e "s/-l 500/-l 1000/" adaBDT03.sh
nohup ./goada.sh > anything

Why not cd into the destination before running the script, so that it creates the output files in there, and use nohup ../../goada.sh?