[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: |
Greg Wooledge |
Subject: |
Re: SECONDS=0 does not reset SECONDS, or I'm missing something |
Date: |
Thu, 4 Jun 2020 09:58:39 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Jun 04, 2020 at 03:52:50PM +0200, Andreas Kusalananda Kähäri wrote:
> I might have been a bit imprecise in describing my issue.
>
> Most of the time, removing the directories takes less than a second.
> For these cases, I don't want to execute the sleep at all. Only when a
> call to rm takes more than one second do I want to sleep.
So, use "time rm ..." with the TIMEFORMAT variable set how you like.
Capture the output of time into a variable (trickier than it sounds),
and then sleep only if the variable does not match 0.* .
See <https://mywiki.wooledge.org/BashFAQ/032> for help capturing time's
output.
- SECONDS=0 does not reset SECONDS, or I'm missing something, Andreas Kusalananda Kähäri, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Pier Paolo Grassi, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Steve Amerige, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Andreas Kusalananda Kähäri, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Andreas Kusalananda Kähäri, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, dan braun, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Pier Paolo Grassi, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Andreas Kusalananda Kähäri, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something,
Greg Wooledge <=
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Pier Paolo Grassi, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Andreas Kusalananda Kähäri, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Pier Paolo Grassi, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Eli Schwartz, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, dan braun, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Andreas Kusalananda Kähäri, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Tim Visher, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Steve Amerige, 2020/06/04
- Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Eli Schwartz, 2020/06/04
Re: SECONDS=0 does not reset SECONDS, or I'm missing something, Chet Ramey, 2020/06/04