Hi, Kyrie-
I made a simplified form of that, which can run the AFNI_data6/FT_analysis/FT/ directory of our Bootcamp data; you can run it there for comparison.
First, I made a text file kind of like yours:
The file "test_file.txt" can be made with:
echo "r1" > test_file.txt
echo "r2" >> test_file.txt
echo "r3" >> test_file.txt
Then I ran:
#!/bin/tcsh
set sublist = (`cat test_file.txt`)
foreach sub ($sublist)
echo "You are on sub $sub"
\ls FT*${sub}*HEAD
end
... and that worked for me without error, outputting:
You are on sub r1
FT_epi_r1+orig.HEAD
You are on sub r2
FT_epi_r2+orig.HEAD
You are on sub r3
FT_epi_r3+orig.HEAD
One thing it might be worth checking is if there are any bad characters in the text file (can often happen on a Mac, in particular)---can you run:
file_tool -show_bad_all -infiles subslist.txt
... and see if that shows any bad characters, say? That could lead to a weird set error there, I guess.
Additionally, if you change
set sublist = (`cat subslist.txt`)
to
set sublist = ( 001 002 003 )
... and things work OK, then the issue might be a weird/bad character in that subslist.txt file.
Barring that, I would probably have to share a link with you to share the script and text file, and I could look at it in more detail.
--pt