update
This commit is contained in:
parent
98e1ee645a
commit
99c95d1dfa
4
bashrc
4
bashrc
|
@ -10,9 +10,9 @@ function show_date() {
|
||||||
# Define the dot file to store the selected adjective
|
# Define the dot file to store the selected adjective
|
||||||
dotfile="$HOME/.adjective_of_the_day"
|
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 [[ -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
|
# read the stored adjective from the file
|
||||||
selected_adjective=$(cat "$dotfile")
|
selected_adjective=$(cat "$dotfile")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue