Hamlib/doc/split-man.pl
Stéphane Fillod, F8CFE f564337994 Initial release
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@229 7ae35d74-ebe9-4afe-98af-79ac388436b8
2000-10-22 15:48:55 +00:00

23 lines
490 B
Perl
Executable File

#!/usr/bin/perl
if ($#ARGV < 0) {
die "where do I put the results?\n";
}
# mkdir $ARGV[0],0777 or die "Can't create $ARGV[0]: $!\n";
$state = 0;
while (<STDIN>) {
if (/^\.TH \"[^\"]*\" 4 \"([^\"]*)\"/) {
if ($state == 1) { close OUT }
$state = 1;
$fn = "$ARGV[0]/$1.4";
print STDERR "Creating $fn\n";
open OUT, ">$fn" or die "can't open $fn: $!\n";
print OUT $_;
} elsif ($state != 0) {
print OUT $_;
}
}
close OUT;