Talk:Native shebang: Difference between revisions
Content added Content deleted
(Example problem) |
|||
Line 59: | Line 59: | ||
== Problems == |
== Problems == |
||
The intro paragraph talks of a "third language" without identifying a second language (presumably the first language is the unix shell). Why? |
The intro paragraph talks of a "third language" without identifying a second language (presumably the first language is the unix shell). Why? Is the "third language" a reference to the idea that C binaries are typically being "interpreted" by <code>ld.so</code>? |
||
The C example doesn't work for me (unless a segmentation fault from script_gcc.sh can be described as "working" or a bad interpreter error from echo.c can be described as "working"). --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 2014-03-24T01:45:49 |
The C example doesn't work for me (unless a segmentation fault from script_gcc.sh can be described as "working" or a bad interpreter error from echo.c can be described as "working"). --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 2014-03-24T01:45:49 |
||
Line 65: | Line 65: | ||
:If you are sure it doesn't work then flag it as incorrect and put any extra info to help in recreating your problem here in the talk page. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:04, 26 September 2014 (UTC) |
:If you are sure it doesn't work then flag it as incorrect and put any extra info to help in recreating your problem here in the talk page. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 07:04, 26 September 2014 (UTC) |
||
Here is what I get on OpenBSD (and OSX) |
Here is what I get on OpenBSD (and OSX). Note that I obtained script_gcc.sh from the unix shell implementation as there was no such file defined in the C implementation. |
||
<pre>$ chmod +x /usr/local/bin/script_gcc.c echo.c; ./echo.c Hello, world |
<pre>$ chmod +x /usr/local/bin/script_gcc.c /usr/local/bin/script_gcc.sh echo.c; ./echo.c Hello, world |
||
./echo.c: line 6: syntax error near unexpected token `(' |
./echo.c: line 6: syntax error near unexpected token `(' |
||
./echo.c: line 6: `int main(int argc, char **argv, char **envp){'</pre> |
./echo.c: line 6: `int main(int argc, char **argv, char **envp){'</pre> |
||
I was able to get it to work on Linux. |
|||
So I think (a) the C implementation should include the script_gcc.sh file, since that is a part of what it needs to run at all, and (b) the implementation should be documented as being non-portable, and only working on Linux. The task description should probably also be changed to more thoroughly document this volume of code that an implementation might need. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 23:21, 13 July 2015 (UTC) |
|||
<pre>$ chmod +x /usr/local/bin/script_gcc.c echo.c; ./echo.c Hello, world |
|||
-bash: ./echo.c: /usr/local/bin/script_gcc.c: bad interpreter: No such file or directory |
|||
</pre> |
|||
Does it work for you? If so, what do you have for /usr/local/bin/script_gcc.sh (which is referenced by the C implementation, but not included in the C implementation)? Also, what OS are you using? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 23:10, 13 July 2015 (UTC) |