I am writing a shell script, and need to calculate the first and last days of a quarter from the current date.  This is for use in Ingres 10 SQL statements triggered from within the script. The Ingres runs on a Solaris server with ksh.So, if today is 31/01/17, I would want to calculate the followingthe first date of the current quarter (01/01/17) the last date of the current quarter (31/03/17). It would be OK here to return an exclusive to date if necessary (i.e. 01/04/17)the first date of the previous quarter (01/10/16)the last date of the previous quarter (31/12/16). An exclusive-to result of 01/01/17 would also be OK. Can anyone please help? I've seen questions related to getting the quarter number but that's not really helping.I've tried the following but its not working as the variables are not being populated in the case statementCURR_MONTH=`date +%m`echo Current month num = $CURR_MONTHCURR_YEAR=`date +%Y`echo Current year = $CURR_YEARlet LAST_YEAR = $CURR_YEAR - 1echo Last year = $LAST_YEARcase $CURR_MONTH in05) CURR_Q_FROM = 01.04.${CURR_YEAR}CURR_Q_TO = 30.06.${CURR_YEAR}PREV_Q_FROM = 01.01.${CURR_YEAR}PREV_Q_TO = 31.03.${CURR_YEAR} ;;esacecho Current Q From = $CURR_Q_FROMecho Current Q To = $CURR_Q_TOecho Prev Q From = $PREV_Q_FROMecho Prev Q To = $PREV_Q_TOI get the following outputCurrent month num = 05Current year = 2017Last year = 2016Month to be extracted = April 2017./stats_report_monthly.sh[85]: CURR_Q_FROM:  not found./stats_report_monthly.sh[86]: CURR_Q_TO:  not found./stats_report_monthly.sh[87]: PREV_Q_FROM:  not found./stats_report_monthly.sh[88]: PREV_Q_TO:  not foundCurrent Q From =Current Q To =Prev Q From =Prev Q To =
ksh get quarter start end dates
ksh;date