I'm new to bash. i'm trying to use a bash script to run another bash script in an automated way. the other bash script is running simulations which i want to be able to do for many values (i have two for loops). i also want to save the results of the simulations after each iteration of the loop and i don't know how to do that in bash. results are produced by root software (from CERN) in a .txt file and i don't know how to access the values inside. thanks in advance to anyone who can suggest something:)
i tried something like this:
ENERGY_FILE="/my_path/energy_values.txt"
while IFS= read -r ENERGY
do
for INPUT in {500..10000..1000}
do
echo "Executing $TARGET_SCRIPT with Energy: $ENERGY and Input: $INPUT"
bash "$TARGET_SCRIPT" "$ENERGY" "$INPUT"
dir_name="output_${INPUT}_${ENERGY}"
mkdir -p "$dir_name"
done
done < "$ENERGY_FILE"