summaryrefslogtreecommitdiffstats
path: root/contrib/amd/m4/chop-aclocal.pl
blob: 2bf6b75f4c1871a13fe1c86842a9d838b3e1b7f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/perl -w

$seq = 1;
$file = "";
$file = sprintf("tmp/%02d.m4", $seq);
open(FILE, ">$file") || die "cannot open \"$file\": $!";
printf(STDOUT "FILE: $file\n");
while (<>) {
    if (/^$/) {
	close(FILE);
	$seq++;
	$file = sprintf("tmp/%02d.m4", $seq);
	open(FILE, ">$file") || die "cannot open \"$file\": $!";
	printf(STDOUT "FILE: $file\n");
	next;
    }
    printf FILE;
}
close(FILE);
OpenPOWER on IntegriCloud