I have several shell scripts that I summarised within a global script. I am using some variables that are the same across all scripts, and I wrote a separate script for this, which I am sourcing in each sub-script. This is what my variables script looks like:
variables.sh
NUMBER="6"
TYPE="${NUMBER}_xyz"
STATE="S05"
DIR="path/file_${NUMBER}_blabla"
FILE="file.txt"
My global script, global.sh, looks like this:
source variables.sh
bash script1.sh
bash script2.sh
...
Now, I need to change the NUMBER variable in my variables script, run the global script, change the number, run the global script again etc. for each number from 6-15. At the moment I am doing this manually every time the global script has finished, but it's taking up a lot of time.