Hi, I have a script with me, whose output needs to be displayed in a HTML via CGI… I have myShell.sh’, which needs to be executed in ‘myCGI.cgi’..
############################################################ #myShell.sh ############################################################ #!Perl_Interpreter_Location print "This is the list of files in ur current dir\n"; `ls -al`; print "End Of Script\n";
############################################################ #myCGI.cgi ############################################################ #!Perl_Interpreter Location Line 1 : print ”Content-Type : html/text ”; Line 2 : print “<HTML>”; Line 3 : print “<BODY>”; Line 4 : print ` etc/webtop/cgi-bin/myShell.sh ` Line 5 : print “</BODY>”; Line 6 : print “</HTML>”;
Now, this would execute the script, but unfortunately all the new-lines get replaced by a blank space..I tried executing with $().. But, it throws Compilation errors..

Replace Line 4(of myCGI.cgi) with the line below..
$("etc/webtop/cgi-bin/myShell.sh");
This gives me an error,
String found where operator expected at
/opt/ibm/netcool/webtop/profiles/TIPProfile/etc/webtop/cgi-bin/myCGI.cgi line 8, near "$("etc/webtop/cgi-bin/myShell.sh "" (Missing operator before "etc/webtop/cgi-bin/ myShell.sh "?) syntax error at /opt/ibm/netcool/webtop/profiles/TIPProfile/etc/webtop/cgi-bin/myCGI.cgi line 8, near "$("etc/webtop/cgi-bin/myShell.sh "" Execution of /opt/ibm/netcool/webtop/profiles/TIPProfile/etc/webtop/cgi-bin/myCGI.cgi aborted due to compilation errors.

Somebody,Anybody please help me out..

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.