Click to See Complete Forum and Search --> : Running a shell script with CGI


magnus
12-17-2002, 05:55 PM
Hello all
I am trying to write a cgi page that will execute a shell script on a linux server using perl. I am very green with perl and cgi so please dont hang me.

Any pointers or a starting point would help alot

Thanks
Magnus

jeffmott
12-18-2002, 09:48 AM
If you want to run the shell script and terminate your Perl script immediately afterward see exec (http://www.perldoc.com/perl5.8.0/pod/func/exec.html), or to execute a system command use the returned value in your Perl script then see command quote operator (http://www.perldoc.com/perl5.8.0/pod/perlop.html#qx-STRING-).

magnus
12-18-2002, 09:59 AM
Thanks Jeff that helped alot

Magnus