This is about as basic as you can get. You get a textbox to type commands into and a run button. Output goes to browser. Probably needs a little work on the security side ;-)
The practical problem you face is that Apache will be running as user nobody or apache (ie not you) so you will be limited in what you can do. There are of course solutions to this problem.
#!/usr/bin/perl
$|++;
use CGI qw( :standard );
use CGI::Carp qw( fatalsToBrowser );
my $command = param('command');
print header, start_form({ -method=>'get' }), textfield({-size=>75,-na
+me=>'command'}),
submit('Run'), end_form;
if ($command) {
open( CMD, "$command 2>&1|" ) or die "$!: running command: '$command
+'";
print "<pre>";
print escapeHTML($_,1) while<CMD>;
print "</pre>\n", end_html;
close CMD;
}
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|