BASH loop to write out file contents with a portion of the file path
I am trying to write a BASH shell script to write out the contents of multiple similar files together with a portion of the file path (which is an ID number).
I have been trying variations on:
for i in `ls /export/research/analysis/human/psanjuan/combat_08247/AUTO_ANALYSIS/triotim/M*/S*/AOD_V01_R0*/behavioral/CALC_RT/hit_rt_run* |cat ; echo "$i"| cut -d "/" -f10,15 ; done
I think I'm close, but it hangs up when I try this.
What I want is to have displayed the contents of each file (a list of reaction times) with the M* value (the ID number of each person) attached to each one. In a perfect world, this would be in columns, but I can live with that not being the case.
Thanks for any help!