Here’s an interesting question I received from a reader:
“In Mac OS X, have you ever done “Get Info” on a shell script, made it
open with Terminal, and had it forcibly execute every time you open the
Terminal app and then exit? Any idea how to fix this? I’ve changed the
path to the script and now it complains that the script is not there but
still forceably exits after failing to execute the original script.”
If you think about this from a Mac OS X “Aqua” perspective, it makes some sense.
If you tell the OS to associate the shell script file with the Terminal, every time you click on the script icon, it’ll be executed in the Terminal application. Just like a PDF bound to Preview, or a JPEG associated with GraphicConverter.
The only reason that I can imagine that a script would be executed when you open the Terminal application has nothing to do with the “Get Info” application binding, and everything to do with what’s in your .login or .bashrc file.
Check those and see if you invoke the script from within one of those. I bet you do, somehow…
In any case, good luck. This is certainly an interesting puzzle!
Please report back.