Path: utzoo!attcan!uunet!sdrc!cinnet!icc!ajm From: ajm@icc.com (Al Marmora) Newsgroups: comp.unix.xenix.sco Subject: Re: Date Highlighted in SHELL ! Keywords: Bourne Shell Date Highlighted Message-ID: <1990Sep6.045915.9335@icc.com> Date: 6 Sep 90 04:59:15 GMT References: <680@csoftec.csf.com> Organization: Intercomputer Communications Corp., Cincinnati, OH Lines: 47 In article <680@csoftec.csf.com> cmanis@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@csoftec.csf.com >--------------------------- > This is what we do here. You'll have to change the REALCAL= line to run under Xenix. Credits: Mike Jenkins 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