From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4898 invoked by alias); 26 Oct 2015 07:39:11 -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: 36969 Received: (qmail 975 invoked from network); 26 Oct 2015 07:39:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Ismail Donmez Subject: Re: Can't redirect segmentation fault error to file Date: Mon, 26 Oct 2015 07:21:42 +0000 (UTC) Message-ID: References: <151023120632.ZM7970@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 213.14.100.128 (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36) Bart Schaefer brasslantern.com> writes: > > On Oct 23, 7:06am, Ismail Donmez wrote: > } > } Suppose I have a crashing executable: > } > } For some reason I want to redirect the segmentation fault error to a file. > > The segmentation fault error isn't printed by the failing command, it's > printed by the shell when it is notified of the failed exit status of > the command. > > Zsh sends job control messages to the "shell output" (typically the > terminal) rather than to standard error, so redirecting standard error > won't trap anything. > > That said, I'm not entirely sure why it doesn't print anything at all: This seems to be contradicting to what bash does: > { ./a.out; } 2> foo > cat foo Segmentation fault (core dumped) > bash --version GNU bash, version 4.3.42(1)-release (x86_64-suse-linux-gnu And indeed zsh always seems to print [1] as if the program goes to background. Well for now I can live with it.