Re: non-blocking stdin from bash

2018-08-14 Thread Richard Hector
On 14/08/18 02:40, Greg Wooledge wrote: > So, yeah. It's warranted. Perhaps. > Idiot. That bit isn't, though. Richard signature.asc Description: OpenPGP digital signature

Re: non-blocking stdin from bash

2018-08-13 Thread Dan Purgert
Greg Wooledge wrote: > On Mon, Aug 13, 2018 at 02:58:54PM -, Dan Purgert wrote: >> Greg Wooledge wrote: >> > [...] >> > It's absolutely warranted. You changed the question, and then you >> > changed the question AGAIN.. >> >> This reminds me of bashphorisms 1 through 3. Although, I guess

Re: non-blocking stdin from bash

2018-08-13 Thread Greg Wooledge
On Mon, Aug 13, 2018 at 02:58:54PM -, Dan Purgert wrote: > Greg Wooledge wrote: > > [...] > > It's absolutely warranted. You changed the question, and then you changed > > the question AGAIN. > > This reminds me of bashphorisms 1 through 3. Although, I guess they're > more related to the

Re: non-blocking stdin from bash

2018-08-13 Thread Dan Purgert
Greg Wooledge wrote: > [...] > It's absolutely warranted. You changed the question, and then you changed > the question AGAIN. This reminds me of bashphorisms 1 through 3. Although, I guess they're more related to the IRC channel. -- |_|O|_| Registered Linux user #585947 |_|_|O| Github:

Re: non-blocking stdin from bash

2018-08-13 Thread Jim Popovitch
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

Re: non-blocking stdin from bash

2018-08-13 Thread Greg Wooledge
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

Re: non-blocking stdin from bash

2018-08-13 Thread Jim Popovitch
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

Re: non-blocking stdin from bash

2018-08-13 Thread Greg Wooledge
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

Re: non-blocking stdin from bash

2018-08-12 Thread Jim Popovitch
On Mon, 2018-08-13 at 10:13 +1200, Richard Hector wrote: > On 13/08/18 05:57, Jim Popovitch wrote: > > Interesting.  I'm using it via a cron script like so: > > > > * * * * *  grep "unusual" /opt/logs/* | /opt/notify.sh `hostname`; > > I don't know what's in notify.sh, but it looks to me like

Re: non-blocking stdin from bash

2018-08-12 Thread Richard Hector
On 13/08/18 05:57, Jim Popovitch wrote: > Interesting. I'm using it via a cron script like so: > > * * * * * grep "unusual" /opt/logs/* | /opt/notify.sh `hostname`; I don't know what's in notify.sh, but it looks to me like you're going to get notified every minute for all the unusual log

Re: non-blocking stdin from bash

2018-08-12 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 12, 2018 at 01:57:09PM -0400, Jim Popovitch wrote: > On Sun, 2018-08-12 at 19:47 +0200, to...@tuxteam.de wrote: [...] > > This will block in the read as long as the line isn't yet terminated. > > But of course fine, if it rocks your boat

Re: non-blocking stdin from bash

2018-08-12 Thread Jim Popovitch
On Sun, 2018-08-12 at 19:47 +0200, to...@tuxteam.de wrote: > On Sun, Aug 12, 2018 at 12:34:08PM -0400, Jim Popovitch wrote: > > [...] > > > Turns out I had mis-read your first reply as "-t 1", chiefly > > because > > Ah, I see. > > > that was all that I had found before posting here.  What now

Re: non-blocking stdin from bash

2018-08-12 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 12, 2018 at 12:34:08PM -0400, Jim Popovitch wrote: [...] > Turns out I had mis-read your first reply as "-t 1", chiefly because Ah, I see. > that was all that I had found before posting here. What now works for > me avoids the -t

Re: non-blocking stdin from bash

2018-08-12 Thread Jim Popovitch
On Sun, 2018-08-12 at 10:36 +0200, to...@tuxteam.de wrote: > On Sun, Aug 12, 2018 at 01:26:40AM -0400, Jim Popovitch wrote: > > On Sun, 2018-08-12 at 00:48 +0200, to...@tuxteam.de wrote: > > > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > > > > Hello! > > > > > > > > What's the

Re: non-blocking stdin from bash

2018-08-12 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 12, 2018 at 01:26:40AM -0400, Jim Popovitch wrote: > On Sun, 2018-08-12 at 00:48 +0200, to...@tuxteam.de wrote: > > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > > > Hello! > > > > > > What's the best way to grab

Re: non-blocking stdin from bash

2018-08-11 Thread Jim Popovitch
On Sun, 2018-08-12 at 00:48 +0200, to...@tuxteam.de wrote: > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > > Hello! > > > > 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? > > I think read is

Re: non-blocking stdin from bash

2018-08-11 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > Hello! > > 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? I think read is your friend (at least in

non-blocking stdin from bash

2018-08-11 Thread Jim Popovitch
Hello! 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? -Jim P.