SOA increment script

I use this:

#! /bin/bash
# rep.sh <pattern> <search> <replace>
for f in $1; do
echo $f
sed s/$2/$3/g $f >$f.tmp
rm $f
mv $f.tmp $f
done

to update various files that have a series of the same datastring in them with a new datastring. It helps things a lot, even down to DNS zones.

My question is, does anyone here know if it's possible to add to this script to increment the serial number in the process and if so, how?

Server is running cpanel if it makes a difference.

Thanks in advance.

 

 

 

 

Top