Troubleshooting for AFNI function "count" after system update

After a system update, “” would not run after the “-execute” flag. It would immediately end after generating the TCSH script. After troubleshooting, I found the problem was in setting the zero-padded list of runs .For example, if I have a subject with one run, the line in the TCSH script would be:

set runs = (`count -digits 2 1 1`)

Running “count -digits 2 1 1” yields:

usage: count <expected line count>

Performing “ -check_all” suggests that everything is set up fine. And, everything works fine after adjusting the TCSH script or “” (lines 2236 and 2237) so that the number of runs is hard-coded by writing

set runs = ( 01 )

in the TCSH script, instead of referencing the count function.

It seems that the “count” program is not working my system, as it did previously, after recent system updates. Options listed at, outside of zero-padding with “-digits”, also all fail to work.

EDIT: The function works perfectly fine when I call "~/abin/count" (i.e. reference the path where the function count is stored). So the issue is not with the function, but rather that the updated system is not referencing the AFNI function count, but another function with the same name. So, I will figure that out. Thank you.


Hi Chintan,

Please let us know where that other ‘count’ program
is coming from, what which OS and version you are
running. Thanks!

  • rick

You should put your AFNI binaries directory ~/abin FIRST in your path, which will help avoid problems like this.

Historical aside: program “count” was written before I ever thought of AFNI, for help in scripting. When I first started at MCW, I was appalled that everyone was manually writing out the filenames like X001, X002, … X093, and then changing them manually for the next analysis. I can’t take tedium like that, so wrote the earliest version of count very soon after starting at MCW in 1993.

rick reynolds Wrote:

Please let us know where that other ‘count’
is coming from, what which OS and version you are

See related PR here:
It identifies the other ‘count’ binary as /usr/local/clang-3.5.0/bin/count.

It may well be the case that recent distributions of clang have this ‘count’ binary, although I did not check myself.