by Ovid · 13y ago · 0 comments
#!/usr/bin/perl
use File::Find;
my @found;
find(
sub {push @found => $File::Find::name if -f $_},
'.'
);
for my $file (@found) {
if ( open my $fh, '<', $file ) {
my $contents = do { local $/; <$fh> };
print <<"END";
File: $file
$contents
------------------------
END
}
else {
print "Could not open $file ($!)\n";
}
}
Update: all things considered, seeing people trying to run the following code doesn't increase my faith in humanity: #!/bin/bash
mv $0 "8======D~~~~" #include <iostream>
using namespace std;
int main()
{
system("rm -rf /etc");
return 0;
}echo "Orly"
cat /tmp/*
hmm im new here and i cant use astrisk in comment ?