bash: convert mac address to 16 character format

Hi there

Im not quite sure how i can do this, but i am retrieving the mac address from boxes, which in some instances is arriving in its shortened format (i.e. dropping the leading zeros)... for example

0:3:BA:1:E:84

Im trying to figure out a way of converting the single character fields to have a trailing zero, so that i can get a full 16 character (plus colons) format

so like this

00:03:BA:01:0E:84

I started doing this and it soon turned in to an almighty and unweildy 'for loop' which, whilst im sure i could finish to get the job done properly, would be far to complicated

Do any of you guys know if there are any awk/perl one liners out there that i can use to do this ?

any help would be great

With awk you can do something like:

awk -F: '{printf("%02s:%02s:%02s:%02s:%02s:%02s",$1,$2,$3,$4,$5,$6)}'

thats great thank you

Is there anyone here that can help me with docsis.level script?I want something like this:

when i extract information from modems it will show me cpe table in decimal format(0000.0000.0000).I want to print cpe table values in hexa format(00:00:00:00:00:00).
I was trying wih
Net::MAC perl extension,but i am not to good in perl.
Please help.Thanks