I'm trying to find a way the use a variable in this command to replace -10 with n_days var:
n_days= -10
date_prefix=$(date -d '-10 day' +%Y/%m/%d)
I tried this way but it didn't work:
date_prefix=$(date -d '${n_days} day' +%Y/%m/%d)
I'm trying to find a way the use a variable in this command to replace -10 with n_days var:
n_days= -10
date_prefix=$(date -d '-10 day' +%Y/%m/%d)
I tried this way but it didn't work:
date_prefix=$(date -d '${n_days} day' +%Y/%m/%d)
Two things:
So:
n_days=-10
date_prefix=$(date -d "$n_days day" +%Y/%m/%d)