macOS Terminal: Script invoked via binary sometimes runs as Groovy instead of through the binary

Category:
➡️ Code-Level Technical Support
➡️ Tag with: macOS, zsh, shell, process, environment-variables I’m seeing unexpected execution behavior on macOS where a script invoked explicitly through a binary is not being passed to that binary.

Example:

Code filebot -script /Users/<username>/score_engine_v3.groovy Instead of being executed inside FileBot’s ScriptShell environment, macOS sometimes compiles the script as a plain Groovy class, producing errors like:

Code No such property: input for class: __script_xxxxx This only happens when macOS bypasses the binary and hands the file to Groovy directly.

Questions:

Under what conditions would macOS bypass the invoking binary and treat a .groovy file as a Groovy script even when the binary is explicitly specified?

Are there known cases where exported environment variables in zsh are not inherited by child processes launched by certain binaries?

Could extended attributes, quarantine flags, or execution policies cause macOS to treat user‑edited .groovy files differently from newly created ones?

Thanks for any insight.

macOS Terminal: Script invoked via binary sometimes runs as Groovy instead of through the binary
 
 
Q