I know that this is a Perl site, but is sed not up to the task?
--MidLifeXis
In reply to Re: Embedding perl in bash by MidLifeXis in thread Embedding perl in bash by wackattack