Allow modules. Do not use temp file.

Include -fmodules switch to allow @import Foundation (or others).

Use bash pipe from subshell so no filtered temp file is needed.

Use awk to better parse the shebang (it doesn't need to be followed by a slash, for example).