From 9bd44f525b8c97407e083697cf0b4fb7eab4e718 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 27 Apr 2017 23:29:00 +0200 Subject: pass filenames as args to fallback.pl --- scripts/fallback.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/fallback.pl') diff --git a/scripts/fallback.pl b/scripts/fallback.pl index 03706c4..971de2c 100755 --- a/scripts/fallback.pl +++ b/scripts/fallback.pl @@ -4,7 +4,13 @@ # use strict; -while (my $line = <>) { +my $in = shift; +my $out = shift; + +open(IN, "<", $in) or die "open (read): $in"; +open(OUT, ">", $out) or die "open (write): $out"; + +while (my $line = ) { chomp $line; # ignore comments @@ -17,10 +23,10 @@ while (my $line = <>) { # continued line? if ($line =~ s/\\\\$//) { - printf "\"%s\"\n",$line; + printf OUT "\"%s\"\n",$line; next; } # write out - printf "\"%s\",\n",$line; + printf OUT "\"%s\",\n",$line; } -- cgit