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

Re: non-blocking stdin from bash



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


Reply to: