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,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16645 invoked from network); 14 Feb 2021 21:20:35 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Feb 2021 21:20:35 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1613337635; b=PGN5mnCiiMMssSjdj/q9AYXFC+h5dmrQVKJflqIk3oRdrCDZvwon+xcUNuj54eGe5ufmJzg1J0 Ff0XsluQK9QdugkAJbXUdsFRndZgW/+waMhT5RMEoI7/+E8hpIbJE9wkSoHYygghPKNhf6MU0u iL8OmOdvR5pYEOQ1uvPsW27PPqryBLnRDJjq42DYHiFmrUxu03n0kEa98UaX8t1U6Moa48oG/F cUDf08OAtxGCZ5RarAafWoKJ1XKmF0FTgHCRVxajl7m8mgcHOe3oW7rIdQ4rzgGm8FF3ev5094 Lu32kQMkehaEK/1i0YjsdfYUAgi1IniXuYkn5L4+Kkcgzw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f177.google.com) smtp.remote-ip=209.85.167.177; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1613337635; bh=kA0vER/tKGxl95ncfNr1UfVLqspJoEvdG9PD+prTA/c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=R3nf4H2r4y1+DX+/1PcMCMkISe1ZvO3l0vR1i4h5RTPKQE/U1KhoRDK06UM20CUTfCkLZ9XnlJ EfIqqOspBI7QpCM31KZjA7IfA7S0TmDoPDPylkGZePkn79nLqCybraERuAtX+blMYAZ40vIIqu C30eazsG9uTrtDQaTUddmMZtS02Ixd8WEK3X7q8xUL+20SdwZUbTyZwh9a/UFZex7knjAG0pal B3XugzWTt7y5Hr68HnePdl0ZayNsrJjxpFrD5Piim/fMgfopaGaG6EBmp7/eNo5B7MGqDOrW0k vS9GmxZTgKn0KqAGSZOhKe4+lKEEpD8f0U5x4xXePk+ecw==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=G6zCxof8otCW7LO6JP4Gs9RD31ESKWIKLM/sD/0Vfbk=; b=Ltr022vUs8daRZs3qqrqr8F/h9 SAyFcz1PZwfZRtBbGKiKhsbmHuROt1JibsiWSKvAC7kEzPbLhvQv7lKi/bqk+rix04LYQtICIv/og arf71xDnsJWEP9Rz+D40YwwpnV0aeXW61TILxSPYi29otvnQftz5X3SafX1ipz5ojXe7rhgVGSTR8 y+56EYH7mwbU4Wx2MOZTKJZpIGmXFKYpYdkGsoKSOUtipUuSgxOs0hX/sYBTz69N7PnweMvFzJ+d4 BMY1mZUHlaZoUVr7GYtWYlyCBCug1aIXlnx6OQTUc0ASvaO+3J0v27geyPvlyR+ffifh/bSOMvt1e SffkbJyA==; Received: from authenticated user by zero.zsh.org with local id 1lBOol-0006he-4P; Sun, 14 Feb 2021 21:20:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f177.google.com) smtp.remote-ip=209.85.167.177; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oi1-f177.google.com ([209.85.167.177]:45299) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lBOoP-0006Kx-Cy; Sun, 14 Feb 2021 21:20:13 +0000 Received: by mail-oi1-f177.google.com with SMTP id q186so1923829oig.12 for ; Sun, 14 Feb 2021 13:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G6zCxof8otCW7LO6JP4Gs9RD31ESKWIKLM/sD/0Vfbk=; b=0zFUnOVQgGXcWb69n+bqkj9NkQ2TSfUvcjcZHmvL7gjxmpDAOxZIYuWu9Ac63Y288R VZcT2u9l7/rrGEsuDwmu5569TSZfmJoGClY9lqKweDLVn3YJhbXYqu+twNRX3zS7TlQl PyCfEdQ7mW8tyTcwVjKBtR0Gm7HMfm2xtP/gzdpmB35UOxEhM8Q7aZIBa+1Mex6O2AIw 97Okwqit+iU4SyQJX+MNFstCfp2/+8cM/0irtpCabySakYh1ynQ4vmCkaNZ/7M1YnCAa eSD+nSx/DESl4PfoHRXN6BRq3T0UBFz7faDWWHvGt9hZbrDBqFTzDaaV21I91PnoF3DT 8Y2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G6zCxof8otCW7LO6JP4Gs9RD31ESKWIKLM/sD/0Vfbk=; b=ixU6C6JlByG+FjzUT2PjHn7BOQz9N+L9K4SKvA4Zh83OYxF2b7SN43ep8bB6g5f6gy FZqYmi2L01+X6GMTdOm0G++DqUB0PK/Xc9+sBqMB4/U7pBOU3LO+mM9ODPezp9XsKASa 7rBZfrWwJLQOpZlqUoRqD+vS3HLpBtqvpdXS1WEd/4LP4M/b/1qp2TIvIaKzb9YmAEb7 8ZD0Ld8WwymPyN/EaNyyGQRYX9MR6Wqr7fF8IVMH4T6oXRh32ADfL0nLSeAOcVZySbLe JvgfTDvsmlQUxngqPsVjo5fOR00D6Mp0ISWfRMDwee2HdIuYwmrp1VP+pfxte8DFwATL vUUw== X-Gm-Message-State: AOAM533V/ybmgTP6XZbZbeOS5gEBPq9HMp8IZEoIlv8ASg5UvCnQOcNN c2NrFpXVL1UTNWmSqRriaocw1b4w2A9a+YwMN337WWRD5mbS2Q== X-Google-Smtp-Source: ABdhPJx2kczFm4dzkwVToCefHJeONYwQlwlY8RYBvJyfQOc/foiRIdvQhC3Mn9bttZsnhoSAMb8DNusv7qZkwGIn+xI= X-Received: by 2002:aca:4e8e:: with SMTP id c136mr6650470oib.173.1613337612402; Sun, 14 Feb 2021 13:20:12 -0800 (PST) MIME-Version: 1.0 References: <20210128102816.GB578422@zira.vinc17.org> <560cef52-aee7-352a-2ba3-25826fe54136@eastlink.ca> <14ce37b2-35ca-6002-474a-7de5d6626a66@eastlink.ca> <05c3d2ba-6a00-9480-e2a8-685432e2442c@eastlink.ca> <20210214173138.GA2298446@zira.vinc17.org> In-Reply-To: From: Bart Schaefer Date: Sun, 14 Feb 2021 13:20:01 -0800 Message-ID: Subject: Re: detect pipe To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26516 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 Sun, Feb 14, 2021 at 12:33 PM Ray Andrews wrote: > > If it is closed, where does input go? Queued up or vanish? File descriptors can be shared among processes. Typically for example the parent shell and any of its children will all have the same standard input, unless there has been a redirection, including creating a pipeline. In the case of a pipeline, if ALL the processes that share a descriptor have closed it, then the writer of the pipeline will get a SIGPIPE signal. The "input" (in this case, the output of the process upstream in the pipeline) is neither queued nor vanishes; the attempt to write fails and it's up to the writing process to decide how to react to that, the default being for it to exit. In the case of a file, the only affected process is the reader, which gets "invalid file descriptor" if it attempts to read from stdin.