Last active
January 27, 2023 06:30
-
-
Save falsycat/e32e152c9e3117a8d360a5b264e3eebe 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
#!/bin/bash | |
rec=$(cat -) | |
n=$(awk '$0!=""{++a}END{print a}' <<< "$rec") | |
sort -g -k $1 <<< "$rec" | awk -v "i=$1" -v "n=$n" '$0!=""{ | |
++a; | |
p = $(i)*(n-a+1); | |
if (p>0.05) exit; | |
for (x=1;x<=NF;++x) { | |
if (x == i) { | |
printf "%f ", p; | |
} else { | |
printf "%s ", $(x); | |
} | |
} | |
printf "\n"; | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment