problem of 3dcalc

3dcalc -a volreg+orig -b stat+orig \ -expr ‘a/b’
++ 3dcalc: AFNI version=AFNI_17.1.05 (May 12 2017) [64-bit]
++ Authored by: A cast of thousands
** FATAL ERROR: Extra command line arguments puzzle me! argv[5]= -expr …

I do not know where is the peoblem.
I would be very appreiciated if you can solve this problem!

I think I fix the problem.

I delete the \ , which is before -expr

now it works!

But I still do not know the reason.

The shell separates command line parameters by
whitespace, such as the spaces before -expr.
But escaping a space tells the shell not to process
it as such, instead it gets passed to the invoked

So with “\ -expr” on the command line, the shell
passes " -expr" (with a leading space) to 3dcalc,
not “-expr” (without).

Similarly, if there were yet more space after the '',
as in " \ -expr", then the space would not be
attached to “-expr”, but would still be passed to
3dcalc, this time as a separate option.

  • rick