I am trying to use the value of the iteration counter in a FOR loop in another mathematical expression inside the loop. Example code:
#! /bin/bash
for i in {100..1}
do
j=$($i-1)
echo $i $j
done
However, this does not work. I want to get the output as shown below:
100 99
99 98
and so on.