| mar94.tar |
Listing 2: dayofwk
#!/bin/ksh # script produces the day of the week from the # System date, except if the time is PM, then the # day is set to what the NEXT day would have been. day=`date|colrm 4` hh=`date|colrm 14|colrm 1 11` if [ $hh -gt 11 ]; then if [ $day = 'Wed' ]; then day1=Thu; fi if [ $day = 'Tue' ]; then day1=Wed; fi if [ $day = 'Mon' ]; then day1=Tue; fi if [ $day = 'Sun' ]; then day1=Mon; fi if [ $day = 'Sat' ]; then day1=Sun; fi if [ $day = 'Fri' ]; then day1=Sat; fi if [ $day = 'Thu' ]; then day1=Fri; fi day=$day1 fi echo $day
|