We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e623c9 commit fc0bcc3Copy full SHA for fc0bcc3
1 file changed
individual-shell-tools/awk/script-07-stretch.sh
@@ -5,5 +5,12 @@ set -euo pipefail
5
# NOTE: This is a stretch exercise - it is optional.
6
7
# TODO: Write a command to output just the names of each player along with the total of adding all of that player's scores.
8
+awk '{
9
+ sum = 0
10
+ for (i = 3; i <= NF; i++) {
11
+ sum += $i
12
+ }
13
+ print $1, sum
14
+}' scores-table.txt
15
# Your output should contain 6 lines, each with one word and one number on it.
16
# The first line should be "Ahmed 15". The second line should be "Basia 37"
0 commit comments