-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added perl script to change npy in dns.in
- Loading branch information
Andrea Andreolli
committed
Sep 15, 2022
1 parent
feff729
commit 7267399
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |