From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28536 invoked by alias); 12 Sep 2016 18:33:04 -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: 21879 Received: (qmail 1249 invoked from network); 12 Sep 2016 18:33:04 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f182.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.182):SA:0(0.0/5.0):. Processed in 0.785292 secs); 12 Sep 2016 18:33:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=EiH427VKMVnZUWc37sUoB52nIX5iqIVJWiKiX6IZJyI=; b=kZJhSHtjTYZXVeyyePvy1H5iZcTUm+BIHSh5XXNmeKGYGHI3Cyv6xv2Th8uLwNBrct WY5RzAFkg7BZkBJiwiAGSTBK+WsCI6sW3+1SPWnG1ky2Et/WxHoAxWMhifIlZE+DjGfY Aijy1spbbLO0eNwmPJYh1PY66axk2awMw5Z52nO/wspwYjkHXa7HqKvO3SFZlJ0ZzD4c 6uCOhj38yyMx+uBLcjDgNUrX/TX3nD/CDfZ+neY0hEMwPwAFMLc8zn6w4BZY/HYN9007 ez1ey5peIEbOVRy0WxmvAtYl2pGbHH/4Lj0fKBB0iiIxiYdamKJJAYsb7d5tDwqEZf7r 8kEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=EiH427VKMVnZUWc37sUoB52nIX5iqIVJWiKiX6IZJyI=; b=dn/BZuoO/+DvXzJI19rCdEqfnxjzJ/WCVqgqnzqdfrVO6BEQkHKdVARPioFkO7S1mL jNB3s0SWTONWuiwFlg0FKg8T52+FjFzDQiiptHD+pr67w2CWPpLiHsIK/a11jCOYqbM8 WW8a7BSb8aCOcX0uyUGQYVlSEfhevNlI1qJTJaZdUnAwJklSXXTJQJQZKjADL3z1HUGg uNeKfmoD/qVIP72q/uI57KDuL+P8wJ8CENkfWeKpr3pNuUlKEyJ3NoyUuJi+cbcKKDZ0 Cd/uTyCF7bmJugQiIkU/0O2IMP7aum+I66pIkqjo3t6xcze5QOAM9VZ3hLsSN3f8S3x7 CrBw== X-Gm-Message-State: AE9vXwPx3ORIP682PqX0C0xCPZrE2Y879uRnceY0R5qtBtdykJv/LFZXW5uA6hM8GsZ7KA== X-Received: by 10.98.23.140 with SMTP id 134mr35813395pfx.96.1473704683060; Mon, 12 Sep 2016 11:24:43 -0700 (PDT) From: Bart Schaefer Message-Id: <160912112451.ZM25357@torch.brasslantern.com> Date: Mon, 12 Sep 2016 11:24:51 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Do file descriptors survive to subshell?" (Sep 12, 6:29pm) References: <20160912171959.2516a91e@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Do file descriptors survive to subshell? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 6:29pm, Sebastian Gniazdowski wrote: } } BTW., read -t -u seems to succeed as many times as there are lines in } a file (file descriptor), that's rather unexpected, it rather should } do some "read char, put char back" thing, or something not changing FD } position in file I would say ?? That's not how "read" is defined. It either reads a line if it can, or it returns failure if it can't. The -t option only changes what "it can't" means, and the -u option only changes where it reads it. You can change how "a line" is defined, but you can't define "a line" as nothing. You might suggest that -k 0 should test whether reading is possible and return success without actually reading anything, but as currently defined "read" returns nonzero only when bytes are consumed.