Scripting question

Jim Murphy friartek at
Wed Nov 6 12:39:29 PST 2002

On Wed, Nov 06, 2002 at 08:18:59PM +0000, Antony Stone wrote:

Hadn't seen this one before.  Runs a little slower, but gets around
leap year better.  But thats what I like about Linux/Unix, there is
always more then one way to do it.  For non leap years you do get an
extra day for the following year.

> #!/bin/bash
> for ((a=1;a<366;a++))
> do
>   date +%m%d%y -d "Jan 01 + %a day"
                              $ - "%" failed testing
Try:  date +%m%d%y -d "Jan 01, 00 + $a day"
If you want to test it on a leap year.

> done



Jim Murphy
email: friartek at
Linux - Debian/FloppyFW/LFS/RedHat

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