File: thanks-gen

package info (click to toggle)
coreutils 8.30-3
  • links: PTS
  • area: main
  • in suites: buster
  • size: 55,016 kB
  • sloc: ansic: 184,556; sh: 24,897; perl: 7,361; yacc: 1,843; makefile: 194; python: 47; sed: 16
file content (16 lines) | stat: -rwxr-xr-x 441 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl -nl
# Use Perl's multi-byte alignment code, via sprintf, while
# performing a rudimentary check for duplicate names and
# removing duplicate name,email pairs.
use Encode;

BEGIN { my (%seen, %name) }

chomp;
my ($name, $email) = split '\0', decode ('UTF-8', $_);

$seen{$name}++
  and warn "$0: THANKS.in: duplicate name: $name\n";

print encode ('UTF-8', sprintf ('%-36s', $name)), $email
  unless $seen{"$name\0$email"}++;