I have bash variable named date_export that have 2021-09-22 as a value.
I want assign it to other bash variable named DATE_EXPORT but having other format 20210922
I tried :
DATE_EXPORT=$(date -d ${date_export} + '%Y%m%d')
But, it does not work, any help, please
>Solution :
The output format is a single word starting with +, not two separate arguments + and the format.
DATE_EXPORT=$(date -d "$date_export" +"%Y%m%d")