custom shell script interpreter is not called on my vserver
Hi
I'm trying to write a simple shell script that compiles .cpp-files and runs the resulting program on the fly. However on my vserver the #!/usr/local/bin/cppscript prefix in my test.cpp file seems to be ignored and sh is used for executing the test.cpp: Quote:
When I run the interpreter directly as follows, it also works fine: /usr/local/bin/cppscript test.cpp or just cppscript test.cpp Another strange thing is when I remove cppscript from /usr/local/bin I do get the "bad interpreter" error. kernel versions are: on the vserver: Linux h1469143.stratoserver.net 2.6.18-028stab060.2 #1 SMP Tue Jan 13 10:24:09 MSK 2009 i686 GNU/Linux on my laptop: Linux tigger 2.6.27-11-generic #1 SMP Wed Apr 1 20:57:48 UTC 2009 i686 GNU/Linux both linuxes are ubuntus. permissions are set to 755 for both cppscript and test.cpp on both machines. here's the test.cpp: Code:
#!/usr/local/bin/cppscript Code:
#!/bin/sh |
just a guess:
maybe your sample cpp script is in utf-8 encoding, but your vserver is not using utf8? this would mean the first character is not "#" (because of the double-byte encoding) and thus not read as shebang to call your interpreter? |
I don't think that's it, because when I change the interpreter to some other interpreter like #!/usr/bin/php it gets executed with that interpreter and when I change it to something nonexisting like #!/usr/local/bin/cppscript2 I get a "bad interpreter" error.
|
All times are GMT -5. The time now is 10:25 PM. |