Jump to content

Talk:Native shebang: Difference between revisions

Suggestion for new wording
m (Sign my question)
(Suggestion for new wording)
Line 1:
=Suggestion for a new wording=
'''Native interpeter for #! aka shebang'''
 
Write a "script" file in your programming language which starts with #! (aka shebang)
and is followed by a path to a binary executable compiled from the same script file.
The executable must then rebuild itself using the contents of the script file.
 
Background:
A shebang line (first 2 bytes of the file are #!) is a message (magic word) on UNIX
systems which indicates to the loader/exec function that the following line
should be used as a path and arguments to a call to exec, with the argument 0 set to
the executable after the shebang, and argument 1 set to the path of the file itself.
 
The effect is that by using a shebang line, we can have a file executed by the
specified interpreter. The interpreter must be a binary file executable on the system.
 
Programming languages which cannot generate a binary executable should ignore this
task.
--[[User:POP|POP]] ([[User talk:POP|talk]]) 16:02, 25 September 2014 (UTC)
 
 
==What is this task asking for?==
I don't quite understand what this task is asking for, as arguably what it asks for is how many language implementations already work under the covers. In what way would <code>#!/usr/bin/python</code> not be a reasonable way of achieving it with Python? (All <code>/usr/bin/env</code> really adds is convenient path searching.) –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 04:30, 3 September 2013 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.