#!/usr/local/bin/perl # # Program to take the NIS+ FAQ and HTML it. # # $txtfaq="NIS+_FAQ.txt"; $htmlfaq="NIS+_FAQ.html"; open (TEXT,"$txtfaq") || die "Can't open $txtfaq\n"; open (HTML, ">$htmlfaq") || die "Can't open $htmlfaq"; $headbool = 0; print HTML < NIS+ FAQ

NIS+ Frequently Asked Questions

EOT while ( ) { chop; #Remove endof line if ( ! $headbool ) { if ( /(^[ \t]*)([1-9]+[.][0-9]+)(.*)/ ) { if ( $1 eq "" ) { $t=""; } else { $t="__"; } print HTML "$t$2 $3
\n"; } elsif (/^[-][-]+/) { print HTML "
\n"; $headbool = 1; } else{ print HTML "$_
\n"; } } elsif ( /^[ \t]*([1-9]+[.][0-9]+)(.*)/ ) { print HTML "

$1$2
\n"; } elsif ( /(.*)([Ss]ection[ \t]*)([1-9]+[.][0-9]+)(.*)/) { print HTML "$1 $2 $3$4
\n"; } elsif ( /(.*)([Ss]ections[ \t]*)([1-9]+[.][0-9]+)(.*)([1-9]+[.][0-9]+)(.*)/) { print HTML "$1 $2 $3$4$5$6
\n"; } else { print HTML "$_
\n"; } } print HTML <


Send additions/corrections to: Ray W. Hiltbrand

This was generated by a perl filter.
Filtered by: Ray W. Hiltbrand
EOT close(TEXT); close(HTML);