I have scheduled a Bash script to run on the 1st of the month but I need to create 2 variables in it with the 1st and last date of the previous month, whatever those may be.
You can try following date commands regardless of the day you are executing them to get first and last day of previous month
Firstday=`date -d "-1 month -$(($(date +%d)-1)) days"` Lastday=`date -d "-$(date +%d) days"`