by _jsn · 12y ago · 0 comments
The open command does allow you to specify command-line arguments to pass to the application (via --args), which is generally a safer way to do things.
So, doing Foo.app/Contents/MacOS/Foo is often the only way to launch a GUI app while inheriting the full environment that you have on the command line.
I often have to do this to launch various developer tools, and have them be able to inherent important environment variables, e.g. database credentials or secrets,
Uh? I’ve been using open to pass NSZombieEnabled and other debugging stuff to apps all the time and it works.
From man open(1):
Opened applications inherit environment variables just
as if you had launched the application directly through
its full path. This behavior was also present in Tiger. Opened applications inherit environment variables just
as if you had launched the application directly through
its full path. This behavior was also present in *Tiger*.
Sigh, I'm old...