PDA

View Full Version : Exec PLEASE HELP!


WebWench
03-20-2003, 06:46 PM
I need an example of a cgi that is executing a shell script on
a unix box via a click on text or even a button.
I am a unix admin and we have shell scripts that we would
like to let the operators use via the web rather than turning
them loose on the command line.

I understand that this will use the exec function but I'd really like to see it used. (I'm that sort of learner.)

I REALLY appreciate any assistance that I can get!!
Thank You

YUPAPA
03-26-2003, 11:50 PM
You can use the system function


Example:


#!/usr/bin/perl
use strict;

print "Content-Type: text/html\n\n";
system('ls -al');

__END__