Created
October 7, 2016 18:02
-
-
Save hashbrowncipher/22f39d6c9dcb6b8a0070d8f5e793cdfa to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
chrt -p -i 0 $$ | |
file="$1" | |
field="$2" | |
lines=$(awk -v field=$field '$field ~ /[0-9][0-9.]*/ { count++ } END { print count }' "$file") | |
sort -k$field -nr "$file" | awk -v lines=$lines ' | |
NR==1 || | |
NR==int(lines * 0.00001) || | |
NR==int(lines * 0.0001) || | |
NR==int(lines * 0.001) || | |
0 == NR % int(lines * 0.01) | |
' "$file" | \ | |
paste - <( | |
echo "max" | |
echo "p99999" | |
echo "p9999" | |
echo "p999" | |
for i in p{99..01}; do echo $i; done; | |
echo "min" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment