Scripting question

Simon Geard delgarde at ihug.co.nz
Sat Nov 9 02:30:22 PST 2002


Joern Abatz wrote:

> On 2002.11.06 20:08 Archaic wrote:
> 
> > I needed to create a file with everyday of the year in mmddyy form.
> >...
> > Any suggestions?
> 
> All in one line:
> 
> N=0 ; while [ $N -lt 365 ] ; do date -d'1 jan 2002 +'$N'days'
> +'%m%d%y'; N=$((N+1)) ; done > newfile ; unset N

Not quite - the year is hardcoded, and so doesn't allow for leapyears.
Try integrate it with the check for the number of days I posted earlier.
:)

Simon.
-- 
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