From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18735 invoked by alias); 17 Feb 2017 08:16:12 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22472 Received: (qmail 7435 invoked from network); 17 Feb 2017 08:16:12 -0000 X-Qmail-Scanner-Diagnostics: from thoth.sbs.de 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(192.35.17.2):SA:0(-5.0/5.0):. Processed in 0.831726 secs); 17 Feb 2017 08:16:12 -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=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: Andre.Albsmeier@siemens.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at siemens.com does not designate permitted sender hosts) Date: Fri, 17 Feb 2017 09:16:04 +0100 From: Andre Albsmeier To: zsh-users@zsh.org Cc: Andre.Albsmeier@siemens.com Subject: exec'ing $0 in traps Message-ID: <20170217081604.GA59728@bali> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) When sending SIGHUP to this script: #!/bin/zsh echo started trap 'echo trapped; exec "$0"' 1 echo $$ > /tmp/blafasel while read line; do echo line $line done restarting works exactly one time and then no more. With FreeBSD's native /bin/sh or even the lousy /bin/bash it works as expected. What am I doing wrong? -Andre