Scripting question

Jason Gurtz jason at
Wed Nov 6 13:15:06 PST 2002

> #!/bin/bash
> for ((a=1;a<366;a++))
> do
>   date +%m%d%y -d "Jan 01 + %a day"
> done

Wow, he wins in my book.  However "%a" should be "$a" and the output
formatting needs help via sed:

for ((a=1;a<366;a++))
        date +%M%D%Y -d "Jan 01 + $a day" | \
        sed s/^00//g | sed s/[0-9][0-9][0-9][0-9]$//g

nice!  (yea, the sed could be cleaned up a little)



Unsubscribe: send email to listar at
and put 'unsubscribe blfs-support' in the subject header of the message

More information about the blfs-support mailing list