X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=macros%2Fcalendar;h=b56784cee6203720c75154f099b35e31b9ade50c;hb=fced9f31f3947c647eab57be43fc30c003c98ecb;hp=a8f8dd649019e4b38daf8ab8e73b374684d47745;hpb=88f810ea1d815a37dc57d380e8c8ebaaa16b9466;p=shellwiki diff --git a/macros/calendar b/macros/calendar index a8f8dd6..b56784c 100755 --- a/macros/calendar +++ b/macros/calendar @@ -43,7 +43,7 @@ while [ $# -gt 0 ]; do case $1 in fi;; esac; done -[ "$*" ] || set -- "*" +[ "$*" ] || set -- "." [ "$depth" -ge 0 -o "$depth" -le 0 ] 2>&- || depth=0 read DY DM DD <<-EOF @@ -68,6 +68,7 @@ rrexpand() { local junk1 start end rrfreq rrint rrend evtitle evlink junk2 while read -r junk1 start end rrfreq rrint rrend evtitle evlink junk2; do + [ ! "$start" ] && continue # empty line [ "$rrend" -eq -1 ] && rrend=9999999999 if [ "$start" -lt "$dend" ] && @@ -274,7 +275,6 @@ cal_month() { dcnt=$((iday - idow * 86400 + ws * 86400)) dow=$ws dcal="$(date -ud @"$dcnt" +%d)" - events="$( printf %s\\n "$events" \ | rrexpand "$dcnt" "$((dcnt + 42 * 86400))" \