AFNI Message Board

History of AFNI updates  

|
April 14, 2021 09:05AM
Howdy-

OK, I just sent you a link for uploading. If possible, having dACC_sigmask.nii and a couple of the other *.nii files would be useful.

I also just noticed something else worth commenting about in this script: within your for-loop, you are using the ">" to redirect to a text file. This will *not* concatenate to what exists in the file, instead overwriting it each time. Since you are in a loop, I assume that you would probably want to use ">>" to redirect with concatenation in each case, instead.

If you want to clear the file first, and then start redirecting each time (e.g., in case you re-run the script, you could use something like the following:
#!/bin/tcsh

# redirect nothing into each file, with the overwriting form of redirection; 
# effectively starts an empty file, or empties a preexisting text file
# printf does not even put a newline char at the end by default (as echo would)
printf "" > FILE1.txt
printf "" > FILE2.txt

foreach var ( ${some_list} ) 
    # at each iteration, redirect into a text file, but in "concatenation" mode
    SOMETHING >> FILE1.txt
    SOMETHING_ELSE >> FILE2.txt
end

--pt
Subject Author Posted

foreach loop errors

kyrieamara April 13, 2021 03:44PM

Re: foreach loop errors

ptaylor April 13, 2021 04:38PM

Re: foreach loop errors

kyrieamara April 13, 2021 05:15PM

Re: foreach loop errors

ptaylor April 14, 2021 09:05AM

Re: foreach loop errors

kyrieamara April 14, 2021 02:37PM

Re: foreach loop errors

kyrieamara April 14, 2021 05:23PM

Re: foreach loop errors

ptaylor April 14, 2021 05:39PM

Re: foreach loop errors

ptaylor April 14, 2021 05:37PM

Re: foreach loop errors

kyrieamara April 14, 2021 05:45PM

Re: foreach loop errors

Pawel April 14, 2021 11:54AM

Re: foreach loop errors

kyrieamara April 14, 2021 02:40PM



Sorry, only registered users may post in this forum.

Click here to login