Skip to content

Commit 6e4d5a5

Browse files
Add sorting and unique filtering commands
1 parent b5089a2 commit 6e4d5a5

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +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 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+
9+
sort -k3,3r scores-table.txt

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +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+
9+
sort -k3,3nr scores-table.txt | head -n 2

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ 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+
10+
uniq events.txt

0 commit comments

Comments
 (0)