How to print the day before yesterday date in bash shell script

Printing the day before yesterday date in the UNIX/Linux/Bash shell script is easy, here is the code:

date +%Y%m%d -d "2 days ago"

Demo

[[email protected] ~]$ date
Thu Nov  7 02:30:08 EST 2019
[[email protected] ~]$ cat date.sh
#!/bin/bash
# printing day before yesterday date in unix shell script
DAY_BEFORE_YESTERDAY=$(date +%Y%m%d -d "2 days ago")
echo $DAY_BEFORE_YESTERDAY

[[email protected] ~]$ ./date.sh
20191105

The shell script for your reference:

#!/bin/bash
# printing day before yesterday date in unix shell script
DAY_BEFORE_YESTERDAY=$(date +%Y%m%d -d "2 days ago")
echo $DAY_BEFORE_YESTERDAY