Re: SECONDS=0 does not reset SECONDS, or I'm missing something
From:
Greg Wooledge
Subject:
Re: SECONDS=0 does not reset SECONDS, or I'm missing something
Date:
Fri, 5 Jun 2020 11:58:35 -0400
User-agent:
Mutt/1.10.1 (2018-07-13)
On Fri, Jun 05, 2020 at 11:42:04AM -0400, Chet Ramey wrote:
> On 6/5/20 7:26 AM, Greg Wooledge wrote:
>
> > Perhaps something like this would work:
> >
> > SECONDS
> > Expands to the difference between the current system time
> > (in seconds) and the system time (in seconds) at shell
> > invocation. If a value is assigned to SECONDS, the value
> > returned upon subsequent references is the value assigned
> > plus the difference between the current system time (in
> > seconds) and the system time (in seconds) upon assignment.
> >
> > Feel free to use that, or tweak it, or discard it. I'm not thrilled
> > with the quadruple repetition of "system time (in seconds)" but I can't
> > think of a clearer way to express it at the moment.
>
> How about just adding a sentence that says the number of seconds at startup
> and the current time is always determined by querying the system clock.
Fine with me, but I'm not the one who was confused by the current
implementation.