Can a script be used as an interpreter by the #! hashbang line?
You can't use a script directly as a #!
interpreter, but you can run the script indirectly via the env
command using:
#!/usr/bin/env /bin/interpreter
/usr/bin/env
is itself a binary, so is a valid interpreter for #!
; and /bin/interpreter
can be anything you like (a script of any variety, or binary) without having to put knowledge of its own interpreter into the calling script.