_『Apache/2でのスクリプト実行環境』 2003-04-04 (Fri) 13:16:13
>Yes, but it's a text file (much the same as a .cmd file). OS/2 cannot run these
>(i.e. give it to DosExecPgm). You need to launch the appropriate "interpreter"
>(cmd.exe for .cmd, sh.exe for test-cgi).
>Unix-based systems interpret the first line of scripts (the #! line) and
>invoke the interpreter for you. On OS/2 Apache does this for you; it reads
>the first line and launches /bin/sh. Of course, this only works if there is
>a /bin/sh (/bin/sh.exe may or may not be enough).
>This is what Apache 1.3.x on OS/2 does to execute a script::
>read some of the file into a buffer
>if( begins with "#!" )
> it's a script
> if not( "#!/" or "#!\\" or "#!_:" )
> /* doesn't look like an absolute path */
> search the path for the interpreter
>if( it's a script )
> launch the interpreter with the CGI name as a parameter
>else if( ends with .CMD )
> launch: CMD.EXE /C "CGI name"
>Therefore, because test-cgi begins with "#!/bin/sh", Apache tries to run
>?:\bin\sh (where ? is probably the drive letter of the Apache installation).
>Try changing "#!/bin/sh" to "#!sh.exe" if you have sh.exe in the path.