On Tue, Jul 23, 2024 at 23:22:52 +1000, Keith Bainbridge wrote:
> The day# in my command prompt increments when I start in the morning. Maybe I 
> need to press enter.

That makes it sound like you're setting the YEAR et al. variables in the
PROMPT_COMMAND variable.

If that's the case, it's *less* wrong, but only a little bit.  You still
have the issue that the date might change while you're sitting at a
stale shell prompt from yesterday, with stale date/time variables.

Really, the fundamental problem here is that you should not be storing
date/time information in long-lived variables, and then trying to use
those variables at an indeterminate point in the future.

Anything that needs to act upon the current date should fetch the current
date immediately before acting.

Reply via email to