sed or not, I find that approach somewhat risque ... while it
doesn't make too much sense there's still nothing to stop a user
from defining hostnames that consist of 10 digits - I don't
think you'd want ALL of those to be equal to your new serial?
That said:
Code:
sed -r -e '/^[\t ]+[0-9]{10}[\t ]*;[\t ]*serial/ s/[0-9]{10}/2011121901/' *
I made the word "serial" a necessary condition for the replacement,
just for sanitys sake. And of course bear in mind that if you change
the file for the 2nd time on the same day the tailing two digits need
to be incremented ... thought I'd chuck that in for good measure. ;}
Cheers,
Tink
P.S.: Beat too it :} ... that's what happens if you start responding
and walk away. =o)