For the things in life which make me glad I'm not dead yet.
Bash – Snip Leading Zeros
With the right regular expression, you can strip all the leading zeroes from your data fields with just a few characters:
[bash]valueWithoutZeroes="$(echo $valueWithZeroes | sed ‘s/0*//’)"[/bash]
Source: www.askdavetaylor.com