Saving the output from individual shell scripts
0
votes
1
answer
158
views
I have a bash script that loops over iterations. How do i save the output from the individual scripts in the bash file according to the iteration?
#Working directory
cd /lustre/nobackup/WUR/ABGC/agyir001/
# Set the number of replicates
num_replicates=100
# Loop over the replicates
for i in $(seq 1 $num_replicates); do
# replicate number with leading zeros
rep_num=$(printf "%03d" $i)
output_file="accuracy_results_${rep_num}.txt"
#Run scenario 1,2 and 3 of male contributions
Rscript Scenario_1_male_contributions.R
Rscript Scenario_2_male_contributions.R
Rscript Scenario_3_male_contributions.R
#creating correlated qtl effects for 1000 selected qtls
Rscript Correlated_qtl_effects.R
#Selecting 1000 qtls, creating TBVS and phenotypes
Rscript Breeding_values_and_Phenotypes.R 7500
# prepare phenotypes and genotypes/markers
Rscript /lustre/nobackup/WUR/ABGC/agyir001/scripts/Markers_phenotypes_for_EBV.R
Asked by Mabel
(1 rep)
May 15, 2023, 12:29 AM
Last activity: May 15, 2023, 08:50 AM
Last activity: May 15, 2023, 08:50 AM