SHARE
TWEET

Untitled

a guest Jun 15th, 2018 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. NAMES=$(cat SCORES.txt | cut -d' ' -f2 | sed 's/://' | sort | uniq | tr ' ' '\n' )
  3. echo -e "Players: \n$NAMES"
  4. echo "Who's score would you like to calculate:"
  5. read PERSON
  6. USERSCORE=$(cat SCORES.txt | cut -d' ' -f2-6 | sort | grep "$PERSON" | sed 's/ pts)// ' | cut -d '(' -f2 | awk '{s+=$1} END {print s}')
  7. echo "$PERSON final score : $USERSCORE"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top