1
1
Fork 0
scripts/lifesaver.pl

10 lines
260 B
Perl
Raw Normal View History

#!/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/
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/;
}