AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

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