#!/bin/ksh # # Author: JAMES # Date: 2/12/05 # Purpose: Give the day of the week you were born # # Read birthmonth echo "Enter your birthmonth [MM]" read MM # Read birthdate echo "Enter your birthdate: [DD]" read DD # Read birthyear echo "Enter your birthyear: [YYYY]" read YYYY # Calculate the # of days you've been alive NUMBER=`date +%j` NO_OF_YEARS=`expr 2005 - "$YYYY"` NO_OF_DAYS=`expr "$NO_OF_YEARS" \* 365` CALC=`expr "$NO_OF_DAYS" + "$NUMBER"` echo "You have been alive for "$CALC" days!" cal "$MM" "$YYYY"