This commit is contained in:
Ray Elliott 2023-09-17 19:09:47 +01:00
parent 98e1ee645a
commit 99c95d1dfa
1 changed files with 2 additions and 2 deletions

4
bashrc
View File

@ -10,9 +10,9 @@ function show_date() {
# Define the dot file to store the selected adjective
dotfile="$HOME/.adjective_of_the_day"
# Check if the dot file exists and was modified less than 1 day ago
# Check if the dot file exists and was modified since yesterday
if [[ -f "$dotfile" && $(date -d "$(stat -c %y "$dotfile")" +%s) -ge $(date -d 'yesterday' +%s) ]]; then
# If the dot file exists and was modified less than 1 day ago,
# If the dot file exists and was modified since yesterday
# read the stored adjective from the file
selected_adjective=$(cat "$dotfile")
else