zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: detect pipe
Date: Thu, 28 Jan 2021 07:05:34 -0800	[thread overview]
Message-ID: <560cef52-aee7-352a-2ba3-25826fe54136@eastlink.ca> (raw)
In-Reply-To: <20210128102816.GB578422@zira.vinc17.org>

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.




  reply	other threads:[~2021-01-28 15:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 16:45 Ray Andrews
2021-01-27 23:59 ` Bart Schaefer
2021-01-28  4:57   ` Ray Andrews
2021-01-28  6:16     ` Bart Schaefer
2021-01-28 10:08     ` Vincent Lefevre
2021-01-28 10:28       ` Vincent Lefevre
2021-01-28 15:05         ` Ray Andrews [this message]
2021-01-28 15:45           ` Ray Andrews
2021-01-28 20:58             ` Bart Schaefer
2021-01-28 20:59               ` Bart Schaefer
2021-01-29  1:17               ` Ray Andrews
2021-01-29  2:50                 ` Bart Schaefer
2021-01-29  3:21                   ` Ray Andrews
2021-01-30  0:29                     ` Bart Schaefer
2021-01-30 14:26                       ` Ray Andrews
2021-01-30 19:00                         ` Bart Schaefer
2021-01-30 19:19                           ` Ray Andrews
2021-01-31 19:12                             ` Ray Andrews
2021-01-31 21:28                               ` Bart Schaefer
2021-02-14 17:31                           ` Vincent Lefevre
2021-02-14 19:33                             ` Bart Schaefer
2021-02-14 20:33                               ` Ray Andrews
2021-02-14 21:20                                 ` Bart Schaefer
2021-02-14 22:25                                   ` Ray Andrews
2021-02-14 21:24                                 ` Vincent Lefevre
2021-02-14 21:19                               ` Vincent Lefevre
2021-02-14 21:24                                 ` Bart Schaefer
2021-02-14 21:38                                 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560cef52-aee7-352a-2ba3-25826fe54136@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).