[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read built-in command has a problem in shell function
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: read built-in command has a problem in shell function |
Date: |
Mon, 11 Oct 2021 13:40:41 +0200 |
yea if date didnt have time to do, in one sync case it did, sleep 0.001
wasnt enuff, i didnt test much more
sorry, thanks
On Mon, Oct 11, 2021, 13:37 Robert Elz <kre@munnari.oz.au> wrote:
> Date: Mon, 11 Oct 2021 10:26:12 +0200
> From: Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
> Message-ID: <
> CAALKErHtA-kbmD1wpS7ybwG3buw7RJNtoAw7sLG6FyrLicdDFA@mail.gmail.com>
>
> | i still have hopes it syncs, arent pipes file fifos or something
>
>
> it makes no difference, you cannot sync something
> which has not yet been written, and in the
> examples it us very likely that date has not
> had time to do all tge work it needs to do
> before it can write anything.
>
> In general, reads with small timeouts (like 0)
> are only useful when they are in some kind of
> loop which isdoing something useful while
> waiting for input to (perhaps) arrive.
> (This applies to sh scripts and any other
> programming language - simply testing if there
> is data avaikabke *now* is rarely, though not
> never, useful).
>
>
Re: read built-in command has a problem in shell function, Greg Wooledge, 2021/10/11