diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-27 23:29:00 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-04-27 23:29:00 +0200 |
commit | 9bd44f525b8c97407e083697cf0b4fb7eab4e718 (patch) | |
tree | b32d9c30ccb3073d3b3d06d6c0083009e8b1dd65 /scripts/fallback.pl | |
parent | b739de430878e48eb6b56cadbe59fc65bbf57d51 (diff) | |
download | fbida-9bd44f525b8c97407e083697cf0b4fb7eab4e718.tar.gz |
pass filenames as args to fallback.pl
Diffstat (limited to 'scripts/fallback.pl')
-rwxr-xr-x | scripts/fallback.pl | 12 |
1 files changed, 9 insertions, 3 deletions
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 = <IN>) { 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; } |