help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SECONDS=0 does not reset SECONDS, or I'm missing something


From: Andreas Kusalananda Kähäri
Subject: Re: SECONDS=0 does not reset SECONDS, or I'm missing something
Date: Fri, 5 Jun 2020 19:06:53 +0200

On Fri, Jun 05, 2020 at 11:58:35AM -0400, Greg Wooledge wrote:
> 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.

No, that was me. Yes, mentioning this in the manual in this (Chet's)
way would have made me expect SECONDS to behave the way it's actually
behaving.

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]