Can a script be used as an interpreter by the #! hashbang line?

To make this work you could add the interpreter's interpreter (i. E bash ) to the shebang.

To make this work you could add the interpreter's interpreter (i.e. Bash) to the shebang: #! /bin/bash /bin/interpreter Here are some commands for the custom interpreter.

Bash will then run your interpreter with the script path in $1 as expected.

1 Both /bin/bash and /usr/bin/env work as binary launchers for the interpreter. Thank you! – Zeph Jul 10 at 8:42.

Read the execve man page for your system. It dictates how scripts are launched, and it should specify that the interpreter in a hash-bang line is a binary executable.

Also read man 3 exec. – Ned Deily Jul 9 at 20:52 Thanks for the advice. Both man execve and man 3 exec mention nothing specific on OS X 10.6 about the interpreter needing to be binary, but nevertheless this appears to be the issue at heart.

There are surprisingly few Google results for similar problems, though! – Zeph Jul 9 at 22:19.

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.

I asked a similar question in comp.unix. Shell that raised some pertinent information. groups.google.com/group/comp.unix.shell/... There was a second branch of the same thread that carried the idea further.

http://groups.google.com/group/comp.lang.postscript/browse_thread/thread/e7a3306342c01847/ea0f0cf048404269?lnk=gst&q=executable+postscript+programs#ea0f0cf048404269 The most general unix solution is to have the shebang point to a binary executable. But that executable program could be as simple as a single call to execl().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions