in reply to Re^2: decoding pattern expression
in thread decoding pattern expression

That tells me nothing. I suppose I should have asked before that, do you have to use bash scripting? You probably can do it that way but it really isn't intended for that. And, this is a perl forum, not a bash scripting forum, so you may have to look elsewhere. OTOH, perl is the perfect tool for this problem. Interested in learning something? Check a perl tutorial like the ones on this site, and post what you come up with. We'll help.

1 Peter 4:10