9 lines
207 B
Bash
9 lines
207 B
Bash
![]() |
#!/usr/bin/env bash
|
||
|
|
||
|
join -1 2 -2 2 \
|
||
|
<( awk '{print $2}' input.txt | sort -n | uniq -c ) \
|
||
|
<( awk '{print $1}' input.txt | sort -n | uniq -c ) |
|
||
|
awk '{print $1 * $2 * $3 }' |
|
||
|
paste -s -d "+" |
|
||
|
bc
|