From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15755 invoked by alias); 26 May 2018 00:02:05 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42822 Received: (qmail 16806 invoked by uid 1010); 26 May 2018 00:02:04 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f194.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.223.194):SA:0(-3.7/5.0):. Processed in 3.778526 secs); 26 May 2018 00:02: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=-3.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIMWL_WL_MED,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=B5vTLmIVeyFX8WHQD3k09XIWtTAmz9BlbCVF6nk4DVM=; b=BkXTuttS2st1lnEVT8XAs5HerRGy8J+fz3dMdNseHfkjPQoGOybn3PDCw998FQnQgB op2pErEQPX7Aob9vbDHwiyoYoFIyiUlAHUHhRsXSctCAKZQ2p2UWmN5vzC2BwPqIkXP7 BuffKqYrDwbJo85YPebQThfl/XUyXWuarHTNfsRWhtljyLp3BhrvKkxg7ywilxbxwNxL lt2yILvL7DOR+j2x/GYGHrdFj5zKt1PU595v3uqf5gXN0cz/eZ5q8fF+ooJL0rdvhyIp WKT5xqsdw5BdBwwirkXHpgqgJ/a104xKKp9QAYmohFofLwZQdv0sOu0t0wpKRg7+Hb7t gQVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=B5vTLmIVeyFX8WHQD3k09XIWtTAmz9BlbCVF6nk4DVM=; b=tHWRwIHm0XOwlmb4PjRFmAS3wuF2SXmbij7Hksqk+rt0jXtvzzbqXOb5TBA3wvH7dy G9KzOE6ZdQTipJqlZ7OfyQwrJ0GkPvEQNT2hc0Xd5Aex3vu23Q9NrXHH+VdHNih2PqC3 8RZJe79r4DcgPpTDiN9mMAvckC71QUXbd7MbZvnaxVl0pm1DNBgQqZiM+gncKIZxaoJs yvXozavIRkaFROZhNICZPypUK4jrwWEj+wSrzdW8TRuGyO97kVbICHutoKH1QmOH8exZ OfTHvbtxeYWxvb3C8qBoPucoa1BRQvt1+Z3OE8wmFLalVdPuYuFOfo6s9QhOfTuscayz mrAA== X-Gm-Message-State: ALKqPwed5pOeoMpxTUlsrunaXLfMdH8J1qbkhxDDpm64bgyh4Mw35Zyo o/Uj5i5ZtgnpLov6bUy5ivA18mKGAzU= X-Google-Smtp-Source: ADUXVKKbVnx9oCnqRNUh3qGp2i5kEeXH0IqFy/E0mxIXmuQdBx+qJt7QT5L4rIzIGPbWvzcLe5FO7Q== X-Received: by 2002:a6b:b60a:: with SMTP id g10-v6mr3824350iof.209.1527292915613; Fri, 25 May 2018 17:01:55 -0700 (PDT) From: dana Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: [QUESTION] Inheritance of file descriptors in <( ... ) construct Message-Id: Date: Fri, 25 May 2018 19:01:54 -0500 To: Zsh workers X-Mailer: Apple Mail (2.3445.6.18) Hello, I'm wondering about the following behaviour: % ( fd=3D; exec {fd}>&2; : $( print foo >&$fd ) ) foo % ( fd=3D; exec {fd}>&2; : =3D( print foo >&$fd ) ) foo % ( fd=3D; exec {fd}>&2; : <( print foo >&$fd ) ) zsh: 12: bad file descriptor As you can see, $fd (12) was inherited by the $( ... ) and =3D( ... ) = constructs, but not by the <( ... ) one. Everything works as expected with FDs < 10, though: % ( fd=3D9; exec 9>&2; : $( print foo >&$fd ) ) foo % ( fd=3D9; exec 9>&2; : =3D( print foo >&$fd ) ) foo % ( fd=3D9; exec 9>&2; : <( print foo >&$fd ) ) foo Is this intended and/or desirable? Maybe something to do with the fact = that <( ... ) is itself exposed as a >=3D10 file descriptor? But it seems = smart enough not to re-use the number that $fd had (it uses 13 in this example), = so...? Cheers dana