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,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27884 invoked from network); 21 May 2022 06:34:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 May 2022 06:34:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653114865; b=QBMKSgX+DZleJx+CrnUQCJcQ79o87ExqMzfs1jglNnjCA3D2y35Uzxl9Xi9zyAXwdsOJPdZnkm Kmx/bBriZb4y5cw4ukDLf9C6m+cJ6GuIuRcTOOoOc0MfVbynjn8m/kpoxFlTfmVpkr/p64V7RH 0hTR7cEJgXljYkWOdyb0pCEZfAKMQsb+s6J+t2V9r/SMcB6JPMKgi7icfF7x+RDNlpDgBOfSt9 qAT/yn5fOGL+OsYsA1zF9g5thmPSOALRUhnTdsFOcNKhMp3OBcxxWnA9lR9vz2AYpsx+ix7Zpz TPf4VHYusqEDOznnt40VAJtfSD/lMXzoZ1dd+C9K8juNGA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; dkim=pass header.d=gmail.com header.s=20210112 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-20210803; t=1653114865; bh=mgdIOn9NQwdQnHaVv5QvqzRSUWGJTs/dyP4MByeBOYc=; 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=dYefysdisESV5Td82Y+n9juydV28CtBY7cLzA5rv1vei1RB2wgVx0FfW3D8N5KLh4zIvzdNcBK qJGrwX5WGOtbRBmkIOtiQGQy1+/DhRfPL90FQhEnqhuXC6djSgFZh6EWQUn8LfgYtHYj9l17RQ 48aQ1rv16aYV1MfY51/3yPyxXLv3/dO1CcDQpnnDpmZjcBZujw4l3mIH4G3wRosIQI07pd234N UXLTX9zn+idrbvzZ3AF+vbFqGS/n8hsMIJd47cqUuDbvA0R77TQTKIyl8WkaWMn8f5MINKh30l 6svzpDkJ+kyF1sWgh8Uu0QnUUmsfoVtXiap5fKa+BA5cbg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; 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=/y0cyfnNEz59U5yEGnv3x+eZSAxrG6WVEjzeE/I+xyc=; b=lck5FoQ0M8wjy5irI+2ptNpbDV SRW4UdwOmCZr/7DClR9dvYBvDbwF+RwomKFRYsVlLh13asqQyRiAjm8jZrhJaR1TreRwW0dDaVu61 TNTpZYdli03AXMwUtFKpdwdFOE5aQKYW8ccG5vTg2sMNaj++PO8eTUZcLATvW6LFhwFD8GZr+kW/h GMWkjlyIPiw5HfN5TjeXSTesSZ6XI/nL99QdOdOiroVcttBjQMYf49yjXyKEcmSUabt5L/aAAfu2R p8nXM8ooF0Lt5ywTglS3zlsrlvVW1ESXQskPL/fIhVx3qoVoB+CkqTRqeye03ys8rcmqw+Y5721Co EvDn1KYQ==; Received: from authenticated user by zero.zsh.org with local id 1nsIgz-0007zR-EL; Sat, 21 May 2022 06:34:25 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f46.google.com ([209.85.128.46]:47006) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nsIcW-0005wa-LB; Sat, 21 May 2022 06:29:48 +0000 Received: by mail-wm1-f46.google.com with SMTP id n6-20020a05600c3b8600b0039492b44ce7so5353458wms.5 for ; Fri, 20 May 2022 23:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=/y0cyfnNEz59U5yEGnv3x+eZSAxrG6WVEjzeE/I+xyc=; b=WC0Zw0fnad9MzO2Ar2I4WgtwyxAf0uzjgVAa5wLQS/kuVGrduTLB2vTXitpmIv7nLH QVSe3SYXpYXd5vCcxzlsmC4dLDD9HSKHyxYL+FmxbkYvL4bLrrF3yOKe+SMBSbpJNOez zZN2c2ANHhvlRllbv9E6sr0KxOAY+jwWugcD13lOBk3+sQzMtTfudhgUng8D0wFx5INN pYrjxPwTrFf4k1S6GdpHdA1R4/N3FvPSlb4gScaJNctNR2P4/ZxpaLfQJzy9/ALo43ny uVmL6663i0PS5qqng518EvsiiAd8nW3klf9CnAR87It9mnBD0SKom+FMESuUdLW80l0S SyBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/y0cyfnNEz59U5yEGnv3x+eZSAxrG6WVEjzeE/I+xyc=; b=V8E0RtqpaSvzIJAwY2CH+FgT+pC08SLP0unuPeaCy2XZZGHQ+7lxLrmiKGn/IRH5E1 Z1oblJTdZ+YoQXMkCtzmAYhVZ91366jXmdmJBlmVMkxDRlS10wvy9OHtQ9Zp1FU1UCmv jwDYTrtgHeqkR/q3m4DjvJ0lJETzpS3EnuulcWCo9nVKFBd6Z047ypMWvcrJjWKSSPxJ 57Bg5a8/MdQn2PWUiob1aOSxR15D/BN+s2vFvMOElumPE8pwaN9WmhcvRP+NVOsbi3x5 Uos4ZMD5KqACkN7Ry12YUiYLdJE2Q5hP5hRVsCUjNBLZTQ3NQCBmXu9C+dE2ZJleldmm q/hg== X-Gm-Message-State: AOAM530YrGj2yaTKhaXjmdPRiDiOuwjWNSsftbmcm/2y5L0hIZG4FFIf 7eR4E/+27PKCE3qnnRP8+fMF8WlT4VGbQCra9meoBpV+ X-Google-Smtp-Source: ABdhPJyBTJtyx6wGho76rPZRlNTGj5lp5aINDY6zfUuNGAbyIdtW69OL+4bPa8uWl5iO+8FhwIRufHGtNIFE/vCTOvs= X-Received: by 2002:a05:600c:501e:b0:394:8b0a:3ec9 with SMTP id n30-20020a05600c501e00b003948b0a3ec9mr11127524wmr.0.1653114588120; Fri, 20 May 2022 23:29:48 -0700 (PDT) MIME-Version: 1.0 From: Zach Riggle Date: Sat, 21 May 2022 01:29:37 -0500 Message-ID: Subject: Close *all* file descriptors To: Zsh Users Content-Type: multipart/alternative; boundary="000000000000cc4c6305df7fbb43" X-Seq: 27776 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: --000000000000cc4c6305df7fbb43 Content-Type: text/plain; charset="UTF-8" Hello all! This is probably an usual request, but is there any way to close (or redirect to /dev/null) all open file descriptors known / opened by zsh? Let's assume I have e.g. exec {mynewfd}>&2 And various other redirections / file descriptor creations / dups. Is there a way to close all of them in a concise way that does not affect e.g. shell pipelines and redirection (i.e., stdout and stderr)? *Zach Riggle* --000000000000cc4c6305df7fbb43 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello all!

This is probably an usual request, but is there any way to close (or = redirect to /dev/null) all open file descriptors known / opened by zsh?

Let's assume I have e.g.

=C2=A0 =C2=A0 exec {mynewfd}>&2

And variou= s other redirections / file descriptor creations / dups.

Is there a way to close all of them in a concise way that does not a= ffect e.g. shell pipelines and redirection (i.e., stdout and stderr)?
=

Zach Riggle

--000000000000cc4c6305df7fbb43--