To add closure on this, the easy bit was fixing a couple of typos. The more surprising bit was realizing that .bashrc is NOT processed in a non-interactive shell.
On a mac, in order to run afni/suma/etc. from a non-interactive shell (such as from a script), one must take an extra step to pass on the DYLD vars.
For example, it might be good to put something like this in the .bashrc file:
export BASH_ENV=~/.bash_dyld_vars
While ~/.bash_dyld_vars could look like:
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace
- rick