Skip to content

Commit 1f5f139

Browse files
committed
refacotring the code
1 parent 1216855 commit 1f5f139

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

individual-shell-tools/awk/script-06-stretch.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,4 @@ set -euo pipefail
66

77
# TODO: Write a command to output the total of adding together all players' first scores.
88
# Your output should be exactly the number 54.
9-
awk '{
10-
sum = 0
11-
for (i = 3; i <= NF; i++)
12-
sum += $i
13-
print $1, sum
14-
}' scores-table.txt
9+
awk '{sum +=$3} END {print sum}' scores-table.txt

0 commit comments

Comments
 (0)