Hi, Osman-
I think that particular error message means that "$mask_dset" is somehow purely empty, and therefore it looks like nothing is there, and that "-setA" is the name of the mask dataset... which the code is having a hard time opening, hence the error.
So, I think you should verify that you have set mask_dset correctly---e.g., with a print statement prior to that?
Note once that is solved, you can use AFNI's gen_group_command.py to set up the ttest for you, writing the command to a text file (here, called cmd_ttest.tcsh), which you can then execute (e.g., "tcsh cmd_ttest.tcsh"):
gen_group_command.py \
-command 3dttest++ \
-write_script cmd_ttest.tcsh \
-prefix out_ttest \
-dsets $dirA/s01/s01.results/pACC.z+tlrc*HEAD \
-subs_betas '0' \
-options \
-mask ${mask_dset}
--pt