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

Re: non-blocking stdin from bash



On Mon, 2018-08-13 at 10:40 -0400, Greg Wooledge wrote:
> On Mon, Aug 13, 2018 at 10:34:40AM -0400, Jim Popovitch wrote:
> > On Mon, 2018-08-13 at 08:59 -0400, Greg Wooledge wrote:
> > > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote:
> > > > What's the best way to grab anything that's in stdin into a
> > > > variable inside a bash script, but won't block if stdin is
> > > > null?
> > > 
> > > On Sun, Aug 12, 2018 at 01:57:09PM -0400, Jim Popovitch wrote:
> > > > Interesting.  I'm using it via a cron script like so:
> > > > 
> > > > * * * * *  grep "unusual" /opt/logs/* | /opt/notify.sh
> > > > `hostname`;
> > > 
> > > On Sun, Aug 12, 2018 at 06:45:23PM -0400, Jim Popovitch wrote:
> > > > That was just an example of what I'm doing.  In reality
> > > > logtail's
> > > > in there, but it made the example line too long.
> > > 
> > > https://mywiki.wooledge.org/XyProblem
> > > https://mywiki.wooledge.org/BashFAQ/064
> > 
> > Come on, that's not warranted.... or you just like posting links to
> > you
> > own site.  smh.
> 
> It's absolutely warranted.  You changed the question, and then you
> changed the question AGAIN.

Not at all.  Even your original slicey-dicey copy+paste shows that I
used the word "like" when describing the crontab, and my original
question never defined anything about what I was doing, rather it asked
a question about how to do something.

> The original question was about testing whether stdin has input
> characters AVAILABLE

Nope. Go back and read my original question, pls.

-Jim P.



Reply to: