From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13773 invoked from network); 11 Jun 2021 19:18:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Jun 2021 19:18:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1623439083; b=LzmeX0UnlYWjfd5HK6eeHavXJi22YtyFso3NyKSW2xqWZjGHbqh2ADUrGI9h25ZWDizm6C4CIL YrqiH/9ZFPz1GZZiSBZrT92CAiUSHDSTftEdPXNPUjShY7lKKmdqiqY6X6xcQpNT3ridFH8q17 z81hXUOz7v2YTrftSeyBA6bI4DQIdhQlbQ/9GC/wPMf98TO4N1g4jaE4dmt2vcKEnkHpuU8tEw jw+phBghyeG2LPO0pGsp5uLEb77p5wA+0A2xO4OeZi3y/f3xCB2SmdOfLU8qIyQOCsTYyW6B7f NW1QzzMYnt7bi5gWV38qct18y2Iok239hrEVoQlv5vdoDA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f43.google.com) smtp.remote-ip=209.85.128.43; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1623439083; bh=sNzSBAIjO4fVogJlqE2z5QKBfRzhUoTsbvKSleKdEik=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=wVeAaMhMLfndeUlyK+57h5mH42B8/tbvRZMMeilypszq3RJ1Vaw3KLeejfZd01HkkWAL9cr+JA fHKtIP+1mGLpCOvxeZ4olV+eW/HOP1wF/+WcB9sZpT3X+7AjByBcg9UWDyhkuUse2ze6S8O3KP o/LZrvRRwn3qblQZey/PJpwqKZ3IR8njJgWJZ0JJvOixik0Q/WLMEhZezHUfqDyah6DAW6JMdE h2MdQ4bIuoMZjdbANwXSgy9nOsvl+eCX8XOei6oIu5dILWg+btUePbjfyfKNxQF/6iZwUT0bPI BrVmWDrlis6M/nL6e91CQRL2+NSpYprXIZz3ktAx7K+4pQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=AbpKM5Sdm2lU3UUaVedeXVjaEDkHg96lC/WB47V4VdI=; b=BCrH5hwX9g87H9WyrcPV0En8O7 /SvwRkXiGUlT+DYfb02Jqawn6pbjaA/tvYLNu48komD/2xjtwMQnydbBCizBzqDeOGwTQWtozbI2V MX5Zp1zyAhHypv5gBrbDB09arxymVn9lDixFSpEdEGRlj5N0RwQYsfCxByf2AQPMp4nZUQRveDU6Q 5awpJ0bsxymdTDBBJCZnpCG1bzQlkbNBrBCGCms6EBkeWTBzY3HAIAcOKuSDdjU6djpMhT9DrKK4n wyBHLDEo6LONLsbiCynbVvcBCNtDJkgadDV0zHJtoZ+5lGFYrsIj/i153h2q5OlsvPWMCFDiek2lO zAlW1ZfA==; Received: from authenticated user by zero.zsh.org with local id 1lrmfG-0009Mq-R3; Fri, 11 Jun 2021 19:17:58 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f43.google.com) smtp.remote-ip=209.85.128.43; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f43.google.com ([209.85.128.43]:33591) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lrmee-00096t-38; Fri, 11 Jun 2021 19:17:20 +0000 Received: by mail-wm1-f43.google.com with SMTP id s70-20020a1ca9490000b02901a589651424so6825217wme.0 for ; Fri, 11 Jun 2021 12:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=AbpKM5Sdm2lU3UUaVedeXVjaEDkHg96lC/WB47V4VdI=; b=CCazzXfNUgNChcBSKWkGneEWDH/+AgV/mYAxnR4R2AD7OV7Xe7odHRNe63hGwI3kh0 QKbbUKPEwWtmRrY2VRaMO9WvytqUmHaqUGTvWUOTBjN/wV5X+fMYJH4BVFk9gYIFKA9e 7BR7kn2ZD8bDUkg2s7kIUAmNTi1sYLJyGB6z+VCaXhEpC+n17vDXv+caKQr/g7+G638Q F06O+NuiXmvfB6VcbtH8TxLmaGwVgjetwRTl9ZB2j/fbQ0AVBE8FdhlIdPxVdzaCQT6g Y1mtkiNFmpI+IFYtmQPiZ/TTam4Sx/vkZ93A/fW1KShTcChUOwZx4F9cJqmH47tszKoH Fckg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=AbpKM5Sdm2lU3UUaVedeXVjaEDkHg96lC/WB47V4VdI=; b=qqJ9CIJRopFiW8lDUsFqetGQ/3vhPr/mlS5wUFq/Lr9kRAbzpfHBdNQldeFcYMHmRR VhIdML1cyIsK1IqcvwNzEcpTOjz3QqZDGU2i4zIws7jwWftJBDCQfHjThyaZRlHjWkct NXMNeWyC/wJCzzcnBhEqiU6kl7tMcldKUAm7vvr1Sr3+fmhWlkCetZMt/5oYsawLLcxo B2j5KcM8fNDqYJsEhVcxvGmv2yhJ4nf+xu7aqQKt7HuhH5a/qTxjUsUzMsfF5EKrq6Lw h3W+94EPM7IrD14mlgpsqUJLFrWM6dXuzKyNWdn+tjTqupgIIqDVvDdTL240B+MggOBh WdvA== X-Gm-Message-State: AOAM530931ALneFjeq/tHOwI/WaSXjru01mQj0CVEX6dCv8/Kj4M0E6Y jM0cbiW1bamcuFKFkfBaoKJ2KTBEaOtChi2zI4iua8BAKPYqbQ== X-Google-Smtp-Source: ABdhPJxPhzme/LltnDPLNq5EgXBjjkO6TnRDkmOTi13sv6s9qwLpA/+qHzdrQ40gAZnZnsOhbvytEBSCWJS5Idj5ru0= X-Received: by 2002:a05:600c:20d:: with SMTP id 13mr5487542wmi.174.1623439039426; Fri, 11 Jun 2021 12:17:19 -0700 (PDT) MIME-Version: 1.0 From: Zach Riggle Date: Fri, 11 Jun 2021 14:17:08 -0500 Message-ID: Subject: Where is this =(:) construct documented? To: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 49057 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: It's insane, cool, and I can't find this documented anywhere. It creates a temporary file that is automatically deleted... but only after the line / expression terminates. ( ... ) creates a subshell (terminology?) ( : ) creates a subshell that does nothing =bash evaluates to the path to bash, e.g. /usr/bin/bash $(...) captures the output of a subshell, e.g. x=$(echo foo) If follows, then, that =(:) shows the path to... what? Apparently, a scope-tracked, auto-deleting temporary file. *Where is this documented?* # wat.zsh #### wat() { >&2 echo IN WAT >&2 ls -la "$1" echo "$1" }ls -la $(wat =(:)) ############# # example ##### $ zsh wat.sh IN WAT -rw------- 1 zachriggle wheel 0 Jun 11 14:13 /tmp/zshfMERth ls: /tmp/zshfMERth: No such file or directory ############# What's more insane is that the temporary file will be auto-populated with the output of the =() construct. Where is THAT documented? ############# $ (){ echo $1; cat $1 } =( echo allo ) /tmp/zshpfFAOp allo ############# Zach Riggle