Created
November 7, 2022 03:40
-
-
Save scottwalters/3d62d8418ef70a61c08918af68d992e3 to your computer and use it in GitHub Desktop.
Revisions
-
scottwalters created this gist
Nov 7, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/sh LINES=17 PLAYERS=/home/ah/players/ #while true;do cd $PLAYERS echo "-----------------------------------------------------------------------------" echo -n 'Number of active players: ' echo `ls -1 *.o | wc | awk '{ print $1}'` echo 'List of top players as of: ' `date` echo " Level 20 with 10 quests solved is Wizard" echo "-----------------------------------------------------------------------------" echo "" echo "Name Lev Hours Name Lev Hours Name Lev Hours" echo "" egrep '^level |^cap_name |^age |^experience ' *.o | sort -r | sed -e 's/\.o:/ /' -e 's/\"//g' | awk ' $2=="level" { level = $3; } $2=="cap_name" { name = $3; } $2=="experience" { experience = $3; } $2=="age" { if ( level < 21 ) printf("%-11s %2d %09d %3d\n", name, level, experience, $3/30/60); age = 0; name = "XX"; }' | grep -v -e '[A-Z][a-z]*test ' | sort -s -r -n -k 3 | sort -s -r -n -k 2 | cut -c 1-15,26-100 | pr -l$LINES -t -3 -w 80 --expand-tabs=8 --sep-string=' ' | expand -t 8 | head -$LINES # pr despite all of the args still insists on inserting tabs, which break formatting when viewed on the MUD, # but thankfully expand exists to remove tabs with the correct amount of space.