diff options
author | Patrick Simianer <p@simianer.de> | 2014-10-09 20:47:23 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-10-09 20:47:23 +0100 |
commit | e0b634754d1bef33dc8e72509c6990cccc32745a (patch) | |
tree | 95d77abef518a333830881dbbd661f14f94868c3 /key_count | |
parent | 254c27ed4af938f0b9c4a21cb99b75f8cc1cd1b2 (diff) |
alles neu macht der mai
Diffstat (limited to 'key_count')
-rwxr-xr-x | key_count | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/key_count b/key_count new file mode 100755 index 0000000..deaa522 --- /dev/null +++ b/key_count @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +STDIN.set_encoding 'utf-8' +STDOUT.set_encoding 'utf-8' + +h = {} +h.default = 0 +while line = STDIN.gets + line.strip! + h[line] += 1 +end + +h.each_pair { |k,v| puts "#{k} #{v}" } + |