I have a fileA that contains:
0012,001650,0089
I want to get the sum of column 1 and column 2 and the quotient of column 3 and 60. Using awk I tried this
col1=`awk -F, '{print $1}' $fileA | sed 's/0*//'`
col2=`awk -F, '{print $2}' $fileA | sed 's/0*//'`
col3=`awk -F, '{print $3}' $fileA | sed 's/0*//'`
sum=$((col1 + col2))
qou=$((col3 / 60))
But I got this error:
apn_processing.sh[226]: col1 + col2: The specified number is not valid for this command.
Can you give me another solution for this?
col1=$(awk -F, '{print $1}' $fileA | sed 's/0*//')