Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Can't redirect segmentation fault error to file



Bart Schaefer <schaefer <at> 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.




Messages sorted by: Reverse Date, Date, Thread, Author