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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22587 invoked from network); 28 Jan 2021 15:06:11 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Jan 2021 15:06:11 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611846371; b=Tt25esLYZarmpbU00ITmPm8rSeCCNJ2HQwr3QA4MmOGNjwaVaW2CBuvOvC7r0gk29OaEAIUZJU /+c4pqG7QoADovd9MQSa6pcMad7d3z4hKjDMyXiX8Rc7L8NtqmS3l+Bv2l7Pg70MxI3tDjaJSE thpr1yjkdmdrodt8oOk6DuIutELPqkxepLI/eRh8D05VJZEgQJp1r6B+xKLBgrZCw2pQYKxYVI tiWOl3NzdWLOjNSukQNhNAfdptnLSjpj9jmRYGbTkNrqMnmETVm+jYvwQxknWrfUVJBHPpqxe+ RNk7yOOcOuZvFBpro2IdmZaNUbdbD3jjbgYOCFihmpQWrw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1611846371; bh=P+wMIYAUVeTvdsMrFcjeTeifGrezq3BYz5lSvBIDDvs=; 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; b=le3wGHcYtM8iHWx88H3+nvzposJxmetYtToOx9cria6GBgETcIVNq+gWNM5h2IeogAH9zxmnxE ZlvtwEXz2F5RvV6dM3hbbrk6W6PZyYy3TK+7uKgLqbmAJbb+VkyyHoPvKOdskzFeYr3v1NGn1W CVaqyFtzKmQjtDtPbpano6cqBfihDeaFSq2AX91eJDAdCwhHojQVK3jCVMVdwL68fwzf9GO8wQ Fsvf0Obd6n6L6ESwzOaI5kw1XJnGTgx1VemOVDy+tR+c8Fsct6l3nWfITRU8YHiWHg4MAhkUj9 ZDNLnlydpiKlr0ZxVYREFZEpIUOoR7crgi5vLCgjKyTvRg==; 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=GlsWVJd1rSrYRHyBAwDwHV3DmVQp36S28lDLhymGRa4=; b=g/nYzs6a95J3+QVbLkusUW0IP7 4+SEi06ctrn9Q+n26mBkYPidNZ+ouHlJ1E2h/hqpq2NkpfIV/d6zpUpHjCpIkOpUuXyT0CB4FfoB2 NBkenRj7HP/rKrOqph2JiIGrWGOC/oqdt5bo0NxVh0GaMXLHtGGHhPdTUfb/V1CS5RqseTb+wsc23 dnmn3VmcYDZ2cePHJ9TZwPrpB7An6JsqEjVZSn1Cw2sdg/wxWPvHJo8Ty9sXTrf/A1Ay90FvGRPKD 1eYxe4QFECqlSdML0A6c/jJEqhZZxqF14o2kJzKImhj+OUkoFr2/9l7VsPGMRN38Ne7wusRGbjc2e +2S2Y/Ng==; Received: from authenticated user by zero.zsh.org with local id 1l58s4-000DRB-D0; Thu, 28 Jan 2021 15:06:08 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:46454) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1l58rZ-000D3k-0w; Thu, 28 Jan 2021 15:05:37 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta03.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0QNN00GC0DZM7X80@mta03.eastlink.ca> for zsh-users@zsh.org; Thu, 28 Jan 2021 11:05:35 -0400 (AST) Received: from [192.168.0.3] ([24.207.90.194]) by Eastlink with ESMTP id 58rWleNXPnkRC58rXlP0Qm; Thu, 28 Jan 2021 11:05:35 -0400 X-Authority-Analysis: v=2.4 cv=B+J8bMhM c=1 sm=1 tr=0 ts=6012d2bf a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=iYxDFfxYKifS0bpirCsA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedtgdejtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeekvdeuuefffefhvdeuieetffdvtddvjeegueejkeeiudehieetieehgeetvdfhfeenucfkphepvdegrddvtdejrdeltddrudelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrledtrdduleegpdhhvghloheplgduledvrdduieekrddtrdefngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: detect pipe To: zsh-users@zsh.org References: <1b788ada-9c70-78e5-cc2c-1943000f2994@eastlink.ca> <20210128100858.GA578422@zira.vinc17.org> <20210128102816.GB578422@zira.vinc17.org> From: Ray Andrews Message-id: <560cef52-aee7-352a-2ba3-25826fe54136@eastlink.ca> Date: Thu, 28 Jan 2021 07:05:34 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-version: 1.0 In-reply-to: <20210128102816.GB578422@zira.vinc17.org> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 26427 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: On 2021-01-28 2:28 a.m., Vincent Lefevre wrote: > >>>     if [[ -p /dev/fd/0 ]]; then >> The semicolon after ]] is invalid. I get an error >> >> zsh: parse error near `then' No error here.  How can that be?  Virgin shell also reports no error.  This is with Roman's prebuilt core.  Besides, I thought the sem was compulsory, no? >> Actually the issue is nbsp characters in the posted code! ?? Mind ... it was copied and pasted from an editor so yeah, an nbsp could be in there.  Rather rude! > echo "Now is the time for all good men" | noglob test1 'the time' > > I was wondering whether the noglob could introduce a small timing > difference where the LHS command would terminate earlier. > I fired up the same test as last night and the results were the same.  I then removed the 'noglob' from the alias and everything worked fine.  I put the 'noglob' back and ... everything remained fine :-|   But this replicates the strangeness of the thing, it seems unpredictable which is why I smell the same issue -- some sort of microsecond delay of some sort such that the results would flicker as they have.  Bart mentions that piping involves simultaneous activity which sounds like a good place for a bad delay. I'll run it with 'set -x' as Bart suggests once it starts to misbehave again.  I've always had a talent for breaking things. Anyway this is not zsh's problem I think.