From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17029 invoked by alias); 18 Mar 2014 23:31:29 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18625 Received: (qmail 5980 invoked from network); 18 Mar 2014 23:31:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Jan Larres Subject: Re: set -F kills read -t Date: Wed, 19 Mar 2014 12:12:55 +1300 Message-ID: References: <20131202142614.GA27697@trustfood.org> <131202075840.ZM3182@torch.brasslantern.com> <140316122727.ZM11132@torch.brasslantern.com> <140316131323.ZM11227@torch.brasslantern.com> <5327B941.3060605@eastlink.ca> <140317235020.ZM30413@torch.brasslantern.com> <532872BE.1020408@eastlink.ca> <140318104505.ZM15560@torch.brasslantern.com> <5328C3D8.9020603@eastlink.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: yass.opencloud.co.nz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <5328C3D8.9020603@eastlink.ca> On 19/03/14 11:08, Ray Andrews wrote: > On 03/18/2014 10:45 AM, Bart Schaefer wrote: >> Not always true. The point of the -t option is to tell "read" that it >> is in fact more important not to wait than it is to be predictable. > > Ok, but in the context of a pipe can't we have 'wait for the input > that IS coming. Don't wait one second or ten seconds or no seconds, > wait until the input arrives. Wait until the first 'echo' has done its > thing. Ain't that intuitive? When would one ever want 'read -t' to > maybe capture input or maybe not, depending on something > unpredictable? > > echo "a string" | func > > should send "a string" to func absolutely every time. The very > existence of the pipe symbol should say 'wait for it'. Wait for 'echo' > to return. As Peter said this is just normal non-blocking I/O, which is not at all shell-specific let alone zsh-specific. Since you clearly seem to want blocking I/O, why are you using the '-t' argument to begin with? If you just wrote 'read input' it should do exactly what you want. -Jan