Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You should carefully read the wikipedia article about <a href="http://en.wikipedia.org/wiki/Shebang_(Unix)" rel="nofollow noreferrer">shebang</a>.</p> <p>When your system sees the magic number corresponding to the shebang, it does an <code>execve</code> on the given path after the shebang and gives the script itself as an argument.</p> <p>Your script fails because the file you give (<code>/usr/bin/env.1</code>) is not <em>an executable</em>, but begins itself by a shebang.... </p> <p>Ideally, you could resolve it using... <code>env</code> on your script with this line as a shebang:</p> <pre><code>#!/usr/bin/env /usr/bin/env.1 python </code></pre> <p>It won't work though on linux as it treats "<code>/usr/bin/env.1 python</code>" as a path (it doesn't split arguments)</p> <p>So the only way I see is to write your <code>env.1</code> in C</p> <p>EDIT: seems like no one belives me ^^, so I've written a simple and dirty <code>env.1.c</code>:</p> <pre><code>#include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;unistd.h&gt; const char* prependpath = "/your/prepend/path/here:"; int main(int argc, char** argv){ int args_len = argc + 1; char* args[args_len]; const char* env = "/usr/bin/env"; int i; /* arguments: the same */ args[0] = env; for(i=1; i&lt;argc; i++) args[i] = argv[i]; args[argc] = NULL; /* environment */ char* p = getenv("PATH"); char* newpath = (char*) malloc(strlen(p) + strlen(prependpath)); sprintf(newpath, "%s%s", prependpath, p); setenv("PATH", newpath, 1); execv(env, args); return 0; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload