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  

|
Ariel Kanevsky
February 11, 2008 09:56AM
AFNI Nation,

This is a combination of two questions I have asked in the past.

I know that 3dcalc can use shell variables for assignment (such as 3dcalc -a "$shell_variable" -expr 'step(a)' -prefix output_dataset) and that certain programs, like 3dmaskdump, can create datasets on the fly by nesting 3dcalc commands (such as 3dmaskdump -mask '3dcalc -a data_set+orig. -expr step(a))' stuff+orig.).

The question now becomes, how do I call upon shell variables within nested 3dcalc commands (using BASH). I thought it would something like...

3dmaskdump -mask '3dcalc -a "$shell_variable" -expr (step(a))' stuff+orig. > stuff.1D

but AFNI is reporting that the dataset "$shell_variable" cannot be located - essentially that AFNI is looking for a file called "$shell_variable" instead of evaluating the variable.

Methinks this mostly a Unix question concerning the interplay of various quotation marks.

-Ariel
Subject Author Posted

Shell variables inside a nest 3dcalc command

Ariel Kanevsky February 11, 2008 09:56AM

Re: Shell variables inside a nest 3dcalc command

rick reynolds February 11, 2008 10:45AM