From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7871 invoked by alias); 14 Sep 2016 13:50:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39319 Received: (qmail 14388 invoked from network); 14 Sep 2016 13:50:32 -0000 X-Qmail-Scanner-Diagnostics: from 195.159.176.226 by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(195.159.176.226):SA:0(2.5/5.0):. Processed in 0.124097 secs); 14 Sep 2016 13:50:32 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NML_ADSP_CUSTOM_MED,RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: gcszd-zsh-workers@m.gmane.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at m.gmane.org does not designate permitted sender hosts) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Stephane Chazelas Subject: =(...) and clean-up on exit Date: Wed, 14 Sep 2016 14:48:13 +0100 Message-ID: <20160914134813.GA13885@chaz.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mutt/1.5.21 (2010-09-15) Content-Disposition: inline zsh does clean-up the tempfile in: () (echo $1; exit) =(:) () (exec echo $1) =(:) but not in: $ ( () { echo $1; exit; } =(:) ) /tmp/zshcnGWVU $ ls /tmp/zshcnGWVU /tmp/zshcnGWVU $ ( () { exec echo $1; } =(:) ) /tmp/zshK11SXc $ ls -d /tmp/zshK11SXc /tmp/zshK11SXc $ zsh -c 'exec echo =(:)' /tmp/zshX6WCf1 $ ls -d /tmp/zshX6WCf1 /tmp/zshX6WCf1 While not much can be done in the 3rd case and doing something would be cumbersome at best in the 2nd case (like the subshell communicating to its parent the list of temp files to clean up), the first one might be more easily doable? In any case the current zsh behaviour is already better than in ksh93's ">;" where it's not handled at all: $ ksh93 -c '(readlink /dev/fd/3; exit) 3>; x' /home/chazelas/.<#d_19036{;.tmp $ ls -d '/home/chazelas/.<#d_19036{;.tmp' /home/chazelas/.<#d_19036{;.tmp Or bash on systems that don't have /dev/fd as it seems not to clean up the temporary named pipes at all(!): $ bash -c '/bin/echo <(:); echo test' /tmp/sh-np-1012032307 test $ ls /tmp/sh-np-1012032307 /tmp/sh-np-1012032307 -- Stephane