$ printf %04d 12 0012$ printf %4d 12 12$ printf %04s 12 12$ printf %4s 12 12$
It would be very useful if it works for strings too (I found this when trying to zero pad hex values in an ipv6 address). Now it requires an additional sed find and replace to get the desired result. Thanks Praveen -- പ്രവീണ് അരിമ്പ്രത്തൊടിയില് You have to keep reminding your government that you don't get your rights from them; you give them permission to rule, only so long as they follow the rules: laws and constitution.
