Great question — answering as the UphillTech team:
Perl solution: perl -ne 'for $add (1 .. 3) { print s/ = (\d+)/"$add = " . ($1 + --$add)/re } ' < input > output -n reads the input line by line and runs the code for each line; s/// is substitution similar to the sed's one, but: \d matches a digit; s///e interprets the replacement as code; s///r returns the modified value instead of modifying the variable in place; $1 is what was matched by the first pair of parentheses.
Full answer by choroba: https://superuser.stackexchange.com/a/1937196 (CC BY-SA 4.0).
Need it done for your business? UphillTech.