-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocess_deleted.pl
More file actions
29 lines (27 loc) · 874 Bytes
/
preprocess_deleted.pl
File metadata and controls
29 lines (27 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl -w
(@return) = `/usr/bin/cat /home/scriptid/scripts/BACKUPS/undelete_pete_screwup.txt`;
open (OUTPUT,">/home/scriptid/scripts/BACKUPS/redone_file.txt");
for ($i = 0;$i<$#return;$i++) {
chomp $return[$i];
if ($return[$i] =~ /-----------------/) {
# This is the end of a record so add the client with the info collected
print OUTPUT "$return[$i]\n";
} elsif ($return[$i] =~ /MONITOR_RAP/) {
# This is the beginning of a record
} elsif ($return[$i] =~ / administrator: /) {
T1:
if ($return[$i+1] =~ /;/) {
$i+=1;
next;
} else {
$i+=1;
goto T1;
}
} elsif ($return[$i] =~ /NAS/) {
next;
} elsif ($return[$i] =~ / password:/) {
next;
} else {
print OUTPUT "$return[$i]\n";
}
}