#!/bin/sh # # mkdigest [-s] # # -s: return status: 1: error, 5: no change, 6: updated # # This script must be in Japanese EUC code # # $Id: mkdigest,v 1.19 1999/12/01 23:16:03 yasufu-i Exp itohy $ PATH=/usr/bin:/bin:/usr/pkg/bin:/usr/local/bin diaryURL=http://iy.hauN.org/itohy/diary/ diarypath=/home/itohy/public_html/diary digestdir=current digestfile=$digestdir/index.html digestfile_test=$digestdir/index-test.html digesttmp=$digestfile$$ digesttmp2=$digestfile$$-2 digestdays=14 mailaddr=itohy@netbsd.org signature='ITOH Yasufumi' J=' case "$m" in 01|1) j="睦月";; 02|2) j="如月";; 03|3) j="弥生";; 04|4) j="卯月";; 05|5) j="皐月";; 06|6) j="水無月";; 07|7) j="文月";; 08|8) j="葉月";; 09|9) j="長月";; 10) j="神無月";; 11) j="霜月";; 12) j="師走";; *) echo "$0: $m: illegal month number" >&2; exit 1;; esac' umask 22 # parse option retst=0 case "$1" in -t) digestfile=$digestfile_test;; -s) retst=1;; esac # check directory structure cd $diarypath if [ ! -d $digestdir ]; then case $retst in 0) echo "$digestdir: not found" >&2;; esac exit 1 fi # awk should be 8bit through if [ -f /usr/bin/gawk -o -f /usr/local/bin/gawk ]; then AWK=gawk else AWK=awk fi # latest three months diaryfiles="`find . -name '[01][0-9].html' -print | sort -r | head -3`" trap "rm -f $digesttmp $digesttmp2; exit 1" 1 2 3 13 15 rm -f $digesttmp $digesttmp2 # output the head # 注: ${dateline}行目にある空行は、このスクリプトの最後の方で使っている。 dateline=11 nkf << END > $digesttmp
このページには、新しい方から、 ${digestdays}日分があるはず(汗)です。 内容に関してのリンクは、ここでなくて本体のページ(日付や先頭の o のリンクをたどったところ)へどうぞ。
RSS by しゃあるさん END # output the contents dd=$digestdays for file in $diaryfiles do year=`echo $file | sed 's/.*\/\([0-9]*\)\/[0-9]*.html$/\1/'` month=`echo $file | sed 's/.*\/\([0-9]*\)\.html$/\1/'` m=$month; eval $J nkf << END
[next]" } exit 0 }' dd=$? echo '