I'm trying to create simple bash script which stores in x variable number of lines of abc.csv file and then stores in a, b and c variables results of some arithmetic operations. When I run the script I get errors:
let: not found
and
arithmetic expression: expecting EOF: "0.2*"
The script:
let x=$(wc -l abc.csv | awk '{print $1}')
let a_size= $((0.2*$x))
let b_size=$((2*0.2*$x))
let c_size=$((2*0.2*$x+1))
How to perform arithmetic operations properly in this case? Any help would be greatly appreciated.