I am trying to make a UNIX script that calculates how many days and hours are left until a birthday that the user inputs. I am only able to get the user to input his birthday and separate it into days month and year and the current date info but i think i'm doing the subtraction wrong
echo -n "Enter the birthdate (mm-dd-yyyy): "
read bdate
bmonth=${bdate:0:2}
bday=${bdate:3:2}
byear=${bdate:6:4}`
`cdate='date +%m-%d-%Y'/
cmonth=${cdate:0:2}
cday=${cdate:3:2}
cyear=${cdate:6:4}
diffdays=$(( ($bdate - $cdate) / (60*60*24) ))
echo $difdays