CALC "Variable" 未定义

CALC "Variable" is undefined

我正在尝试做:

FIELD1b=0.37920; FIELD1a=0.28069; calc '(FIELD1b-FIELD1a)**2'

但是,我得到的是:

"FIELD1b" is undefined

Error in commands

calc 似乎不理解 shell/environment 变量。您可以将表达式通过管道传递给 calc,例如:

FIELD1b=0.37920; FIELD1a=0.28069; echo "($FIELD1b-$FIELD1a)**2"  | calc -p