Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- NAMES=$(cat SCORES.txt | cut -d' ' -f2 | sed 's/://' | sort | uniq | tr ' ' '\n' )
- echo -e "Players: \n$NAMES"
- echo "Who's score would you like to calculate:"
- read PERSON
- USERSCORE=$(cat SCORES.txt | cut -d' ' -f2-6 | sort | grep "$PERSON" | sed 's/ pts)// ' | cut -d '(' -f2 | awk '{s+=$1} END {print s}')
- echo "$PERSON final score : $USERSCORE"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement