#!/mclab/imc/sun4/rexx -x httpdir="/usr/local/etc/httpd/htdocs/oucl/users/ian.collier" /* This is the root directory of my WWW pages */ outdir=httpdir || '/RexxSource' /* directory in which all files reside */ outfile=outdir || '/index.html' /* the file which will be output */ address command "rm" outfile /* This program prints some text and then a list of files. The text must end with a comment delimiter on a line of its own. */ call print /*
Name Size Last Updated" parse value date(s) with yyyy +4 +2 dd call lineout outfile,"This list was last updated on", dd+0 date('m') yyyy+0 || "." call print /**/ /* This code outputs the list of files. The list comes from "ls". */ list='ls'('-lL',outdir) do while list^=='' parse var list perm linx usr size mon date time name '0a'x list if name='' | name=='index.html' then iterate call lineout outfile,'' || name || '' ||, copies(' ',20-length(name)) right(size,7) || ' ' ||, mon right(date,2) right(time,5) end /* This code outputs the trailing lines of the file. */ call lineout outfile,"