#EXPERIMENT_TYPES=("R-FA" "FA-R" "FA") EXPERIMENT_TYPES=("FA") for EXPERIMENT_TYPE in ${EXPERIMENT_TYPES[@]}; do echo "Running autotrain for experiment type: ${EXPERIMENT_TYPE}" # Export the variable to make it available to envsubst export EXPERIMENT_TYPE=${EXPERIMENT_TYPE} # Substitute the variable into the template envsubst < ./autotrain/autotrain_template.yml > ./autotrain/autotrain.yml # Echo the contents of the substituted YAML file echo "Generated autotrain.yml:" cat ./autotrain/autotrain.yml echo "-----------------------------------" # Run the autotrain command autotrain --config ./autotrain/autotrain.yml # Check if the command was successful if [[ $? -ne 0 ]]; then echo "Error running autotrain for ${EXPERIMENT_TYPE}, exiting." exit 1 fi done echo "All experiments completed successfully!"