Date Highlighted in SHELL !

Al Marmora ajm at icc.com
Thu Sep 6 14:59:15 AEST 1990


In article <680 at csoftec.csf.com> cmanis at csoftec.csf.com (Cliff Manis) writes:
>
>Some months ago I got part of this script from the net and have modified
>it to highlight the actual date of the month.
>
>At present it will highlight the date if the date is two digit only, and I
>have not  been able to make it highlight the first 9 days of the month. We
>are using SCO 2.3.1 and any help would be appreciated... 
>
>and Thanks..   Cliff Manis
>
>Please also mail direct to:  cmanis at csoftec.csf.com
>---------------------------
>

This is what we do here.  You'll have to change the REALCAL= line
to run under Xenix.

Credits: Mike Jenkins <mwj at icc.com> originally developed this script.

#!/bin/sh
#
# cal.sh - highlight today's date if stdout is a terminal
#
# We install this script in /usr/local/bin, which appears
# before /usr/bin in our standard PATH.
#
# 88/12/03 - created (mwj)
# 88/12/19 - fix: don't highlight anything in line 1 (ajm)
# 88/12/19 - fix: highlight only if output is going to a terminal (ajm)
#

REALCAL=/usr/bin/cal

if [ -t 1 -a $# -eq 0 ]
then
	smso=`tput smso`
	rmso=`tput rmso`

	set `date '+%m %d 19%y'`

	day=`echo $2 | sed 's/^0/ /'`
	exec $REALCAL $1 $3 |
	sed -e 's/^/ /' -e "3,\$s/ ${day}/ ${smso}${day}${rmso}/" -e 's/^ //'
else
	exec $REALCAL $*
fi



More information about the Comp.unix.xenix.sco mailing list