Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #198670

Re: non-blocking stdin from bash

From <tomas@tuxteam.de>
Newsgroups linux.debian.user
Subject Re: non-blocking stdin from bash
Date 2018-08-12 19:50 +0200
Message-ID <wm2F3-4cb-3@gated-at.bofh.it> (permalink)
References <wlKf8-1W9-11@gated-at.bofh.it> <wlKRP-28u-1@gated-at.bofh.it> <wlR6W-5Zq-3@gated-at.bofh.it> <wlU4N-7FM-1@gated-at.bofh.it> <wm1zj-3BT-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


-----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 param:
> 
> 
> while read stdin_line
> do
>    MSG=$MSG"\n"$stdin_line
> done < /dev/stdin

This will block in the read as long as the line isn't yet terminated.
But of course fine, if it rocks your boat :-)

> Thanks again,

Hey. You're welcome

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAltwcrYACgkQBcgs9XrR2kYqgwCdH9J+3t6DYuGAcS/23OaZNE1i
seYAn0i65VKWm16CNrmChrmpci01kchP
=ckC2
-----END PGP SIGNATURE-----

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-12 00:10 +0200
  Re: non-blocking stdin from bash <tomas@tuxteam.de> - 2018-08-12 00:50 +0200
    Re: non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-12 07:30 +0200
      Re: non-blocking stdin from bash <tomas@tuxteam.de> - 2018-08-12 10:40 +0200
        Re: non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-12 18:40 +0200
          Re: non-blocking stdin from bash <tomas@tuxteam.de> - 2018-08-12 19:50 +0200
            Re: non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-12 20:00 +0200
              Re: non-blocking stdin from bash <tomas@tuxteam.de> - 2018-08-12 22:00 +0200
              Re: non-blocking stdin from bash Richard Hector <richard@walnut.gen.nz> - 2018-08-13 00:20 +0200
                Re: non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-13 00:50 +0200
                Re: non-blocking stdin from bash Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-13 15:00 +0200
                Re: non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-13 16:40 +0200
                Re: non-blocking stdin from bash Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-13 16:50 +0200
                Re: non-blocking stdin from bash Jim Popovitch <jim@k4vqc.com> - 2018-08-13 17:00 +0200
                Re: non-blocking stdin from bash Dan Purgert <dan@djph.net> - 2018-08-13 17:10 +0200
                Re: non-blocking stdin from bash Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-13 17:10 +0200
                Re: non-blocking stdin from bash Dan Purgert <dan@djph.net> - 2018-08-13 17:30 +0200
                Re: non-blocking stdin from bash Richard Hector <richard@walnut.gen.nz> - 2018-08-14 08:10 +0200

csiph-web