Created
February 8, 2026 12:15
-
-
Save fusion809/04e7606fce685d88a7eeb2a316f38aa0 to your computer and use it in GitHub Desktop.
Generalized script for displaying the percentage of commands provided by each stratum under Bedrock.
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
| commlist=$(compgen -c | sort -u | xargs -n 100 brl which 2>/dev/null) | |
| nocomm=$(echo $commlist | tr ' ' '\n' | wc -l) | |
| function Rcalc { | |
| out=$(R -q -e "$1") | |
| echo "$out" | head -n 2 | tail -n 1 | sed -E 's/^\[1\]\s//g' | |
| } | |
| stratList=$(brl list | grep -v bedrock; echo global;) | |
| stratList=$(echo $stratList | tr ' ' '\n' | sort -u) | |
| echo $stratList | tr ' ' '\n' | while read -r s; do | |
| no=$(echo $commlist | tr ' ' '\n' | grep $s | wc -l) | |
| perc=$(Rcalc "100*$no/$nocomm") | |
| echo "${s^} provides $perc% of commands" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment