#!/usr/bin/perl # sub htencode { local($htencd) = shift; $htencd =~ s/&/&/g; $htencd =~ s/"/"/g; $htencd =~ s//>/g; $htencd; } $str = $ENV{"QUERY_STRING"}; print "Content-type: text/html; charset=iso-8859-1\n\n"; # open(IN, "wc -l $str |"); $len = ; close(IN); chop($len); if ($len > 5000) { $cmd = "head -5000"; } else { $cmd = "cat"; } $htmlbody =< AMXS showSrc
[ __CMD__   __DFN__ ]         EOM $htmlbody =~ s/__DFN__/$str/; $htmlbody =~ s/__CMD__/$cmd/; print $htmlbody; # if (open(IN, "$cmd $str 2>&1 |")) { print "
";
    while ($line=) { print &htencode($line); }
    close(IN);
    print "
\n"; if ($len > 5000) { print "[continued]\n"; } } else { print "
ERROR:\n"; print " File open fail.\n"; } # print "
\n\n\n"; exit(0);