]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/amd/m4/chop-aclocal.pl
MFC version 1.14, from the 4 February 2008 update:
[FreeBSD/FreeBSD.git] / contrib / amd / m4 / chop-aclocal.pl
1 #!/bin/perl -w
2
3 $seq = 1;
4 $file = "";
5 $file = sprintf("tmp/%02d.m4", $seq);
6 open(FILE, ">$file") || die "cannot open \"$file\": $!";
7 printf(STDOUT "FILE: $file\n");
8 while (<>) {
9     if (/^$/) {
10         close(FILE);
11         $seq++;
12         $file = sprintf("tmp/%02d.m4", $seq);
13         open(FILE, ">$file") || die "cannot open \"$file\": $!";
14         printf(STDOUT "FILE: $file\n");
15         next;
16     }
17     printf FILE;
18 }
19 close(FILE);