Skip to content

Commit

Permalink
Added perl script to change npy in dns.in
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Andreolli committed Sep 15, 2022
1 parent feff729 commit 7267399
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions utilities/change_npy.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use File::Copy;

open my $in, '<', "dns.in" or die "Can't read old file: $!";
open my $out, '>', "dns.in.new" or die "Can't write new file: $!";

while( <$in> ) # print the lines before the change
{
print $out $_;
last if $. == 11; # line number before change
}

my $line = <$in>;
$line = $ARGV[0]."\n";
print $out $line;

while( <$in> ) # print the rest of the lines
{
print $out $_;
}

move("dns.in.new","dns.in");

0 comments on commit 7267399

Please sign in to comment.