In bash, you should use $(...)
to store output of a command, not &(...)
.
aux=&(...)
is interpreted as aux=
and (...)
connected by &
, i.e. it clears $aux
in the background, and runs the bc
in a subshell.
К сожалению, это приводит к пустой переменной, и команда bc выводит свой результат на терминал в любом случае, пытаясь приписать aux
aux=&(bc -l <<< "scale = 5; c($*$constant)") echo "$aux"
как я могу сохранить этот результат?
In bash, you should use $(...)
to store output of a command, not &(...)
.
aux=&(...)
is interpreted as aux=
and (...)
connected by &
, i.e. it clears $aux
in the background, and runs the bc
in a subshell.