Last active
December 8, 2016 02:46
-
-
Save note103/09eba7168ef13a8ea34aeed8cc7b0179 to your computer and use it in GitHub Desktop.
そのディレクトリにある各ファイルの行数を出すやつ
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Slurp; | |
my @iter = glob "*"; | |
my $sum = 0; | |
for (@iter) { | |
next if (-d $_); | |
my $line = `wc $_ | awk '{ print \$1}'`; | |
my $name = `wc $_ | awk '{ print \$NF}'`; | |
chomp($name); | |
$name =~ s/\.+\///g; | |
print "$name: $line"; | |
$sum += $line; | |
} | |
print "\n$sum"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment