Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am launching an app from a script using:

open /path/to/foo.app -F -g -W --args -foo bar

When the application crashes (in particular, it seg faults), the window sits open forever and the app does not exit. However, when I launch the app the old fashioned way

/path/to/foo.app/Contents/MacOSX/foo -foo bar

it simply exits and returns a nonzero error code to the script, which is what I want. How can I get this behaviour (exit on seg fault and return an error code) using the "open" syntax above? The motivation is to get access to OSX-specific options such as -F, -g, -W etc.

share|improve this question

1 Answer 1

I would avoid using the -W option. From open's man page:

-W Causes open to wait until the applications it opens (or that were already open) have exited. Use with the -n flag to allow open to function as an appropriate app for the $EDITOR environment vari- able.

This could be your issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.