in reply to Missing new-lines, when script executed in a CGI

Is myShell.sh a shell or a perl program? If the latter, why isn't the she-bang line the first line? If the former, why the print (instead of echo), or the ls in backquotes?

As for your main program, there should be two new lines after the content-type line, there should not be a space in front of the colon, nor should there be a space after the content type. Furthermore, line 4 seems to be missing a leading / in the path. And print `command` is a bit silly - it's saying "execute command, slurp in its output, then print it". Why not just execute the command? Whatever it outputs will be on your output. Oh, and Line 4 is missing a trailing semi-colon. And I do hope the "Line N :" thingies aren't there in reality - labels cannot contain spaces.

Replies are listed 'Best First'.
Re^2: Missing new-lines, when script executed in a CGI
by LinuxUser2008 (Acolyte) on May 11, 2010 at 15:40 UTC
    Thanks for the quick reply JavaFan.. Its a Perl script,by '#!Perl_Interpreter_Location', i meant '#!/usr/bin/perl', isnt this SHE-BANG?
    sorry for the error-prone code..
    I had corrected all the issues pointed out by u, but still i end with the same problem.. Could you please tell me what else could be wrong!!
      Its a Perl script,by '#!Perl_Interpreter_Location', i meant '#!/usr/bin/perl', isnt this SHE-BANG?
      Yes. By my count, it's on the fourth line. '#!' is only recognized by the kernel if they are the first two bytes of the file.