Skip to content

Commit 20b5b4f

Browse files
committed
update
1 parent fbdac0d commit 20b5b4f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -euo pipefail
77
# TODO: Write a command to output just the names of each player along with the total of adding all of that player's scores.
88
# Your output should contain 6 lines, each with one word and one number on it.
99
# The first line should be "Ahmed 15". The second line should be "Basia 37"
10-
awk '{sum[$1] += $3} END {for (name in sum) print name, sum[name]}' scores-table.txt
10+
awk '{for (i=3; i<=NF; i++) sum[$1] += $i} END {for (name in sum) print name, sum[name]}' scores-table.txt

individual-shell-tools/grep/script-07.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -euo pipefail
44

55
# TODO: Write a command to output, for each `.txt` file in this directory, how many lines of dialogue the Doctor has.
66
# The output should show that dialogue.txt contains 6 lines, dialogue-2.txt contains 2, and dialogue-3.txt contains 0.
7-
grep -ci "doctor" *.txt
7+
grep -ci "^doctor" *.txt

individual-shell-tools/sed/script-04.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# TODO: Write a command to output input.txt replacing every occurrence of the string "We'll" with "We will".
66
# The output should contain 11 lines.
77

8-
sed "s/We'll/We will/g" input.txt
8+
sed "s/ We'll/ We will/g" input.txt

0 commit comments

Comments
 (0)