I want to insert a counter into a text file using sed. For example, the file has the following content:
please.add.number.00
Here is the script I'm using:
for i in $(seq 0 10)
do
sed -i 's/please.add.number.00/please.add.number.$i/' filename.txt
done
But the value ($i
) in the file doesn't change. I want to substitute the value of $i in this line of filename.txt. I would appreciate any help to fix this issue!