Scripting question

Joern Abatz mail at abatz.de
Sat Nov 9 08:12:13 PST 2002


On 2002.11.09 11:30 Simon Geard wrote:
> 
> 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.

And on second thought a 'for' loop looks far better than 'while', so in
a one-line-script it would be

for ((N=0;$N -lt `date -d"31 dec $1" +'%j'`;N++)) ; do date -d"1 jan $1
+$N days" +'%m%d%y' ; done

and be called ./script 2002 > newfile

Ok, next one :-)

Joern
-- 
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