I have number of arrays in bash, such as arrKey[]
, aarT[]
,P[]
and I want to do an arithmetic operation with these arrays. As I checked, arrays are working perfectly but, the arithmetic to find array P[]
is wrong.
Can anyone help me with this, please?
#The format is C[0] = (A[0,0]*B[0]) + (A[0,1]*B[1])
this is the code that I tried so far.
P[0]= $(({arrKey[0,0]} * {arrT[0]} ))+ $(({arrKey[0,1]} * {arrT[1]})) ))
echo ${P[0]}