error467 error467 - 3 years ago 210
Bash Question

bump or increment the integer that is a result of grep

Im grepping below file with output below but i want the result to increment it with another number.

egrep -i --color=auto "[0-9]{10}" file
2017080802 ; Xen number

How can I make it to 2017080803 at least?

Answer Source

Something like this?

awk '/[0-9]{10}/ { print 1+$1 }' file
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download