Of course in Vim you have
<C-a> to increment a number.
Is this POSIX specified?
How can I increment (or decrement) a number portably, such as in a scripted edit with
Even if the answer is just "Use an external filter," what would be the best POSIX-specified tool for this job?
Example specific requirement:
- Increment the number found in the final field of line 1 by 1.
- Decrement the number found in the final field of line 2 by 1.
Here is a number: 5 Here is another number: 2
Here is a number: 6 Here is another number: 1