Skip to content

Commit 58e3f27

Browse files
committed
small amendment
1 parent d090663 commit 58e3f27

5 files changed

Lines changed: 5 additions & 5 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
@@ -5,6 +5,6 @@ set -euo pipefail
55
# NOTE: This is a stretch exercise - it is optional.
66

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.
8-
awk '{sum=o; for(i=3; i<=NF; i++) sum+=$i; print $1, sum}' scores-table.txt
8+
awk '{sum=0; for(i=3; i<=NF; i++) sum+=$i; print $1, sum}' scores-table.txt
99
# Your output should contain 6 lines, each with one word and one number on it.
1010
# The first line should be "Ahmed 15". The second line should be "Basia 37"

individual-shell-tools/cat/script-03.sh

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

55
# TODO: Write a command to output the contents of the file `helper-3.txt` inside the helper-files directory to the terminal.
6-
cat ../helper-files/helper-3.txt | nl
6+
cat -n ../helper-files/helper-3.txt
77
# This time, we also want to see the line numbers in the output.
88
#
99
# The output of this command should be something like:

individual-shell-tools/cat/script-04-stretch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
# NOTE: This is a stretch exercise - it is optional.
66

77
# TODO: Write a command to output the contents of all of the files in the helper-files directory to the terminal.
8-
cat ../helper-files/* | nl
8+
cat -n ../helper-files/*
99
# We also want to see the line numbers in the output, but we want line numbers not to reset at the start of each file.
1010
#
1111
# The output of this command should be something like:

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

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

55
# TODO: Write a command to output the name of every `.txt` file in this directory which contains a line of dialogue said by the Doctor.
6-
grep -l "^Doctor" *.txt
6+
grep -l "^Doctor:" *.txt
77
# The output should contain two filenames.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
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.
6-
grep -c "^Doctor" *.txt
6+
grep -c "^Doctor:" *.txt
77
# The output should show that dialogue.txt contains 6 lines, dialogue-2.txt contains 2, and dialogue-3.txt contains 0.

0 commit comments

Comments
 (0)