Hi Monks, I am collecting params from a page and passing it to a shell script. However, I am not getting any error while executing, but the the shell script is not getting executed. I need help on this. I tried different methods, but nothing seems to work.
#!/u001/dev/edw/common/ul/bin/perl #---------------------------------------------------- # Author: Saurav Rout #---------------------------------------------------- use Time::Local; use Date::Calc qw(Delta_DHMS); use CGI qw(:standard); use Scalar::Util qw(looks_like_number); use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; my $q = new CGI; my $appname = $q->param('App_name'); my $email = $q->param('Email_id'); my $table = $q->param('Table_name'); open(OUT, ">/tmp/table_list.lst") or die "Couldn't open output file: $ +!"; print OUT $table."\n"; close(OUT); my $cmd = '/u001/dev/edw/common/ul/cgi-bin/car/code_gen.ksh $appname / +tmp/tablelist.lst "$email"'; $result = `code_gen.ksh $appname /tmp/table_list.lst "$email"`; print header; print start_html("Results"); print<<"end_of_html"; <html> <body> <h2>Thank You for using this tool. Your code is on its way to the emai +l id specifed in the previous page.$appname, $email</h2> <h2>Open the JIL file, edit the calendar related values (Date & time), + then upload/move it to unix for futher usage.</h2> <p> Let me know if you see any scope of enhancement in this tool. -S +aurav Rout(Saurav.S.Rout\@google.com) </p> </body> </html> end_of_html print end_html;

In reply to Running a Shell Program from CGI page by sauravrout

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.