bug-bash
[Top][All Lists]
Advanced

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

Re: read built-in command has a problem in shell function


From: Robert Elz
Subject: Re: read built-in command has a problem in shell function
Date: Mon, 11 Oct 2021 18:28:50 +0700

    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).



reply via email to

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