#! /bin/sh b=`date +%b` # Locale's abbreviated month name. e=`date +%e` # Day of month [1,31]; single digits are preceded by a space. m=`date +%m` # Month number [1,12]; single digits are preceded by 0. Y=`date +%Y` # Year, including the century (for example 1993). tab=" " # The tab character. case ${#} in 2) column=0 month=${1} year=${2} ;; 1) column=`expr \( ${m} - 1 \) % 3 + 1` year=${1} ;; 0) column=0 ;; esac if [ -z "${year}" -o "${year}" = "${Y}" ] ; then E="`tput smso`${e}`tput rmso`" case "${column}" in 0) sedscript=" /${b}/,/^${tab}/s/^${e}/${E}/ /${b}/,/^${tab}/s/ ${e}/ ${E}/ " ;; 1) sedscript=" /${b}/,/^${tab}/s/${e}\( .* ..................... \)/${E}\1/ " ;; 2) sedscript=" /${b}/,/^${tab}/s/^\(..................... .* \)${e}\( .* .....\)/\1${E}\2/ " ;; 3) sedscript=" /${b}/,/^${tab}/s/^\(..................... .................... .* \)${e}/\1${E}/ " ;; esac fi cal "${@}" | sed "${sedscript}"