I'm trying to find the remainder of dividing two numbers, when read from a file.
The input file looks like this:
3
1 2
100 200
10 40
Expected output:
1
100
10
I'm running the following code:
read T
for ((i=1;i<=$T; i++))
do
read A
read B
echo $((A % B))
done
However, this gives an error like the following:
line 6: 1 2: syntax error in expression (error token is "2")
Why doesn't this work for the question at hand?