If you want to save all of those files, just rename them in the loop. Move them to the
${global_path}5.1st_level_analysis/sub-0${i}/func/GLM_INPUT
directory, which is already being referenced for the subject in the loop.
The reason they are being overwritten is presumably because they are written to your current directory. So do something like:
for ((i=1;i<10;i++)); do
for ((j=1; j<6; j++)); do
3dBlurToFWHM -input ${global_path}2.derivatives/sub-0${i}/func/sub-0${i}_task-stress_run-${j}_space-MNI152NLin6Asym_res-2_desc-preproc_bold.nii.gz \
-prefix ${global_path}5.1st_level_analysis/sub-0${i}/func/GLM_INPUT/sub-0${i}_task-stress_run-${j}_space-MNI152NLin6Asym_res-2_desc-preproc_bold_blur.nii.gz \
-mask ${global_path}2.derivatives/sub-0${i}/func/sub-0${i}_task-stress_run-${j}_space-MNI152NLin6Asym_res-2_desc-brain_mask.nii.gz \
-FWHM 6 -detrend
mv 3dFWHMx.1D ${global_path}5.1st_level_analysis/sub-0${i}/func/GLM_INPUT
done
done
Does that seem reasonable?
- rick