I am trying to get the first day of the previous month using shell script using the below command in the format 2017-05-01
Firstday=date -d "-1 month -$(($(date +%d)-1)) days" +"%Y-%m-%d"
But it is throwing the below error.
value too great for base (error token is "09").
Can anyone help please?