#!/usr/bin/perl # sub htencode { local($htencd) = shift; $htencd =~ s/&/&/g; $htencd =~ s/"/"/g; $htencd =~ s//>/g; $htencd; } do "acqPATHs.pl"; $str = $ENV{"QUERY_STRING"}; ($dir, $fnm) = split(/\+/, $str); if ($dir ne "") { $dir .= "/"; } $path = "$DATAPATH/$dir$fnm"; open(IN, "wc -l $path |"); $len = ; close(IN); chop($len); if ($len > 5000) { $cmd = "head -5000"; } else { $cmd = "cat"; } print "Content-type: text/html; charset=iso-8859-1\n\n"; # $htmlbody =< AMXS show
[ __CMD__   __DFN__ ]         EOM $htmlbody =~ s/__DFN__/$dir$fnm/; $htmlbody =~ s/__CMD__/$cmd/; print $htmlbody; # if (open(IN, "$cmd $path 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);