#!/bin/zsh while true do ./thread2 if [[ $? != 0 ]] then break fi done ls -lah core* echo "segv!"