[colug-432] Bash script two digit names

Tom Hanlon tom at functionalmedia.com
Sun Jan 17 17:49:36 EST 2010


Thanks Colug,

I did not expect Bash to have printf

Do we need anything else beside bash :-)

That is great,

--
Tom
On 17 Jan 2010, at 14:33, William Yang wrote:

> 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