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,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32568 invoked from network); 11 Nov 2020 17:11:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Nov 2020 17:11:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605114686; b=nq/aV43BFDQgvIdyV0cz85FSrIuft2zlWT8hhkG7jdKuahOdgQoKMdlHNU4GtiT8gpXD/z4nLZ Yi9tw6UrIl++vML2ZLHexUJZG4WN9ZPsRY/hFpV0u2hHbfh2GX/r/c7ndLl2ea5CWy50UTnVHi l6thuHDDmwUXBRhV719JUMDoDltSdcyfxte7kdn7sQCmbTmytq/IFfgedOatHgOOSfouHbAEeO GVFgz5tCORe0g6k3Bc/YoQiU8IEE0Rf6ojqJPL9gj03FRrY2iEiE+aCfYwou5vTVzXuK3x81FV BQquoHel9AgCcHmmK4fFZ8XlJOH5OofhQccQYeIkseNIUQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605114686; bh=H8D0oswgzAcS69ss+fV+gVLi7gpVt/kbQNEcMRu3Hkk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature: DKIM-Signature; b=rZOAsy8XUurstWcUvzR1sKzNXYneZoETXXac3PrapFugG6FAGi5wdQiVQjvxunRHV5KQZn7yuj 39LuurdyFivjU+mjSDvYI8SMMzVkUM6ogS5vk3l9NcIVsAmZsePGQzPHtT1J5xVfaDb2UUmZJI 4JxB1kCxBQVov85qPc6F9lE9A5oLwNgDkRxz/pLH+EKogVY4SrKyL+tQIi88vm3NiOEXU5AngH U9v9niURMsVJKCNMMBnhc4y03mveGsuqah2eSpZxQTGEowQP9jCvpW9WxsumZ5o3vkblh96jf4 CKziP+L6aXT5nJ8iYXuyBVhDMwAFKp983JXsVsqqhlXmQQ==; 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-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZycnvrBHAQssWNn4PE8/2rFWcK8Ic5g1nYTfh7znn0E=; b=eLpMMGUfWvAsD3kX3ingSXBVOQ WUyeM4aQT8J69YG79R+UGOe3sSZvGZIySi/q9Bxy+MmOid4pEu61IZ9drobwoyIVnLBCoKyZbXP/O DQgFt30AV/h5kC2v/MrEKWlXYvKlEQlnaJ6TDKPmYxN4mENzbPvoSV2Ub6IrtLia5OzJXnWtHh0te jW3FVCsLpUi9MgLvzH8LnIPbY4urgT7ap7h4z0RgLflaUQPwhd0h+D9V7IucdW3FnPZt5OnKexuzx hTa/nsgx5WOSfKuTGni6R+kkbaKSI6mILsPK8OC7Zoj7rTUMLfbawtz+fdIxg20eii7j5DM+L2dUJ mvxPxAPg==; Received: from authenticated user by zero.zsh.org with local id 1kcteY-000OuY-8i; Wed, 11 Nov 2020 17:11:26 +0000 Authentication-Results: zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none Received: from iris.zentaur.org ([198.58.127.206]:35208) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1kcteB-000OYM-Af; Wed, 11 Nov 2020 17:11:03 +0000 Received: from iris.zentaur.org (localhost [127.0.0.1]) by iris.zentaur.org (Postfix) with ESMTP id 4CWWTf2JFxz3wZj for ; Wed, 11 Nov 2020 17:11:02 +0000 (UTC) Authentication-Results: iris.zentaur.org (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=zentaur.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zentaur.org; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s= dkim20200120; t=1605114661; x=1605118262; bh=H8D0oswgzAcS69ss+fV +gVLi7gpVt/kbQNEcMRu3Hkk=; b=D40mnMeL9HMMBAv2iOWEN7DIcYd+pzHb02H FXtLL2MFOKZgD5ftMsvDrP6dqBuMeDdxPvp7T+WLdn2FcV/+0XYWXwarYQbJ7+VI mmSeJz/DJu1gTKlOfL2Bk6R998U0xPGK08ai78nyrnJ7TWmHJP/v2FEtF87e+YiV qGUyXtKXU1s++XHU+RTdCB2PJpqj0b1TjQk2nzbWxIeAchkf6ix8vXaGuNSVh+Zb I/bkHQLfUa9bkQVcrUnctjdErsPDsbVOPqIO1k36gzYrPlhtVLHTLfM0yw8E4xtw lASDoAnFfHbAEGNtaeEovZKNKUp+XhBiXnTdw8rhc+cxx0wFjBQ== X-Virus-Scanned: amavisd-new at iris.zentaur.org Received: from iris.zentaur.org ([127.0.0.1]) by iris.zentaur.org (iris.zentaur.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZmCwzmdPBa44 for ; Wed, 11 Nov 2020 17:11:01 +0000 (UTC) Received: from [10.251.9.140] (rrcs-24-173-95-34.sw.biz.rr.com [24.173.95.34]) by iris.zentaur.org (Postfix) with ESMTPSA id 4CWWTd4yjlz3wZb for ; Wed, 11 Nov 2020 17:11:01 +0000 (UTC) Subject: Re: Odd behavior using MULTIOS To: zsh-users@zsh.org References: <02c5fda1-c1ab-d0a0-9350-a5b122cd1394@zentaur.org> <774738440.1331269.1605112926240@mail2.virginmedia.com> From: Clinton Bunch Message-ID: <590c200a-7f5c-bfa5-bd1f-1bbcad50585e@zentaur.org> Date: Wed, 11 Nov 2020 11:11:01 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 In-Reply-To: <774738440.1331269.1605112926240@mail2.virginmedia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Seq: 26149 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Another thing I noticed is that MULTIOS doesn't appear to work with exec i.e. exec 3>/tmp/test1 3>/tmp/test2 causes the script to hang. I'm not sure why.=C2=A0 Am I just being dense today? On 11/11/2020 10:42 AM, Peter Stephenson wrote: >> On 11 November 2020 at 16:25 Clinton Bunch wrote= : >> Is this the expected behavior? >> >> setopt MULTIOS >> { >> print -u3 "Testing" >> print=C2=A0 "Second Testing" >> } 3>&1 3>/tmp/test >> % zsh test.zsh >> Second Testing >> Testing > You mean the ordering? Yes, as documented "the shell opens the file de= scriptor as a pipe > to a process that copies its input to all the specified outputs". So = this isn't > synchronous within the current shell and you can't rely on ordering. Y= ou'll note > there's nothing there to determine whether the downstream pipe componen= t performs > a write to the terminal before the main shell does --- think of it a bi= t like > > { print Testing; print "Second Testing" >/dev/tty } | tee /dev/tty /tmp= /test > > --- although I'm not guaranteeing they're identical and clearly there's= room > for lots of things in the two processes to affect the ordering. > > pws >