Skip to content

Instantly share code, notes, and snippets.

@note103
Last active December 8, 2016 02:46
Show Gist options
  • Save note103/09eba7168ef13a8ea34aeed8cc7b0179 to your computer and use it in GitHub Desktop.
Save note103/09eba7168ef13a8ea34aeed8cc7b0179 to your computer and use it in GitHub Desktop.
そのディレクトリにある各ファイルの行数を出すやつ
#!/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