I need to display a number of days to upcoming payment day (let's say it is always at 10th of any month).How do I do that in bash ?
Calculate number of days to payment
bash;shell script;date
dom = day of monthdom=6 ; \days=$[ ${dom}-$(date +%-d) ] ; \[ ${days} -lt 0 ] && days=$[ ${days} + $(date +%d -d $(date +%Y%m01 -d 'next month') yesterday) ] ; \echo ${days} days30 days