uisng the command echo $(date "+%F" -d "$(date +'%Y-%m-01') 0 month") i can get the first date of that month. but the same is not working on mac terminal. What needs to be changed?
echo $(date "+%F" -d "$(date +'%Y-%m-01') 0 month")
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]