2013-06-23 13:49:22 +02:00
|
|
|
#!/usr/bin/perl
|
2013-06-23 13:51:44 +02:00
|
|
|
|
|
|
|
#source: http://www.etherealbits.com/2012/06/the-perl-script-that-may-save-your-life/
|
|
|
|
|
2013-06-23 13:49:22 +02:00
|
|
|
open(DEV, '/dev/sda1') or die "Can't open: $!\n";
|
|
|
|
while (read(DEV, $buf, 4096)) {
|
|
|
|
print tell(DEV), "\n", $buf, "\n"
|
2013-06-23 13:51:44 +02:00
|
|
|
if $buf =~ /stringtosearchfor/;
|
2013-06-23 13:49:22 +02:00
|
|
|
}
|