[colug-432] Bash script two digit names
William Yang
wyang at gcfn.net
Sun Jan 17 14:33:28 EST 2010
On Ubuntu, man printf(1). Probably on other distros, too.
-Bill
Tom Hanlon wrote:
> Colug,
>
> I have a bash script that loops and create files.
>
> THink dates..
>
> I go through and create a file
>
> 01_1 for jan first
> 01_2 for Jan second.
>
>
> Problem is I would much rather have
>
> 01_01 rather than 01_1
>
> The loop goes from 1-31 and sets the variable for the loop counter.
>
> Is there a built in utility to make a "one space" integer a "two
> space" integer, or do I have to do that manually ?
>
> Just curious, I am not stumped, but not looking to reinvent the wheel,
> and would like to use a built in if one is available.
>
> --
> Tom
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>
--
William Yang
wyang at gcfn.net
More information about the colug-432
mailing list