Skip to content

Instantly share code, notes, and snippets.

@fusion809
Created February 8, 2026 12:12
Show Gist options
  • Select an option

  • Save fusion809/74ea9e0dcd249da19e6840f53f061edd to your computer and use it in GitHub Desktop.

Select an option

Save fusion809/74ea9e0dcd249da19e6840f53f061edd to your computer and use it in GitHub Desktop.
commlist=$(compgen -c | sort -u | xargs -n 100 brl which 2>/dev/null)
nocomm=$(echo $commlist | tr ' ' '\n' | wc -l)
function Rcalc {
R -q -e "$1" | 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