🌱 Last Day Bash Script

#!/bin/bash
day='Wed'
today=`date "+%a"`

if [ "$today" == "$day" ]
then
  VAR=$(date -v-7d "+%Y-%m-%d")
else
  VAR=$(date -v-"$day" "+%Y-%m-%d")
fi

echo -n $VAR
Made by Brandon . If you find this project useful you can donate.