Skip to content

Commit 451c614

Browse files
committed
fix: address PR review - add trailing newlines, fix -k3 to -k3,3, add editorconfig
1 parent a33d461 commit 451c614

9 files changed

Lines changed: 12 additions & 10 deletions

File tree

shell-pipelines/sort-uniq-head-tail/script-01.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with lines sorted by the person's name.
77
# The first line of your output should be "Ahmed London 1 10 4" (with no quotes). And the third line should be "Chandra Birmingham 12 6".
8-
sort ./scores-table.txt
8+
sort ./scores-table.txt

shell-pipelines/sort-uniq-head-tail/script-02.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with lines sorted by the person's first score, descending.
77
# The first line of your output should be "Basia London 22 9 6" (with no quotes).
8-
sort -k3 -nr ./scores-table.txt
8+
sort -k3,3 -nr ./scores-table.txt

shell-pipelines/sort-uniq-head-tail/script-03.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ set -euo pipefail
88
# Basia London 22 9 6
99
# Piotr Glasgow 15 2 25 11 8
1010
# Chandra Birmingham 12 6
11-
sort -k3 -n ./scores-table.txt | tail -r -n3
12-
# sort -k3 -nr ./scores-table.txt | head -n3
11+
# sort -k3,3 -n ./scores-table.txt | tail -r -n3
12+
sort -k3,3 -nr ./scores-table.txt | head -n3
13+

shell-pipelines/sort-uniq-head-tail/script-04.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ set -euo pipefail
55
# The input for this script is the scores-table.txt file.
66
# TODO: Write a command to output scores-table.txt, with shows the line for the player whose first score was the second highest.
77
# Your output should be: "Piotr Glasgow 15 2 25 11 8" (without quotes).
8-
sort -k3 -nr ./scores-table.txt | head -n2 | tail -n1
8+
sort -k3,3 -nr ./scores-table.txt | head -n2 | tail -n1
9+

shell-pipelines/sort-uniq-head-tail/script-05.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set -euo pipefail
66
# TODO: Write a command to show a list of all events that have happened, without duplication.
77
# The order they're displayed doesn't matter, but we never want to see the same event listed twice.
88
# Your output should contain 6 lines.
9-
sort -u ./events.txt
9+
sort -u ./events.txt

shell-pipelines/sort-uniq-head-tail/script-06.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
# The input for this script is the events.txt file.
66
# TODO: Write a command to show how many times anyone has entered and exited.
77
# It should be clear from your script's output that there have been 5 Entry events and 4 Exit events.
8-
awk '{print $1}' ./events.txt | sort | uniq -c
8+
awk '{print $1}' ./events.txt | sort | uniq -c

shell-pipelines/sort-uniq-head-tail/script-07.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set -euo pipefail
66
# TODO: Write a command to show how many times anyone has entered and exited.
77
# It should be clear from your script's output that there have been 5 Entry events and 4 Exit events.
88
# The word "Event" should not appear in your script's output.
9-
grep -o 'Entry\|Exit' ./events-with-timestamps.txt | sort | uniq -c
9+
grep -o 'Entry\|Exit' ./events-with-timestamps.txt | sort | uniq -c

shell-pipelines/tr/script-01.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -euo pipefail
77
#
88
# TODO: Write a command to output the contents of text.txt with every exclamation mark (!) replaced with a full-stop (.).
99
# cat ./text.txt | tr '!' '.'
10-
tr '!' '.' < ./text.txt
10+
tr '!' '.' < ./text.txt

shell-pipelines/tr/script-02.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -euo pipefail
77
# so every Y should be a Z, and every Z should be a Y!
88
#
99
# TODO: Write a command to output the contents of text.txt with every Y and Z swapped (both upper and lower case).
10-
tr 'YyZz' 'ZzYy' < ./text.txt
10+
tr 'YyZz' 'ZzYy' < ./text.txt

0 commit comments

Comments
 (0)