Scripting question

Jason Gurtz jason at tommyk.com
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:

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

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

~Jason

--

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



More information about the blfs-support mailing list