File tree Expand file tree Collapse file tree
shell-pipelines/sort-uniq-head-tail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,3 +8,5 @@ set -euo pipefail
88# Basia London 22 9 6
99# Piotr Glasgow 15 2 25 11 8
1010# Chandra Birmingham 12 6
11+
12+ sort -k3,3rn ./scores-table.txt | head -n 3
Original file line number Diff line number Diff 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,3rn ./scores-table.txt | head -n 2 | tail -n 1
Original file line number Diff line number Diff 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+ sort ./events.txt | uniq
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ 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+
9+ awk ' { print $1 }' ./events.txt | sort | uniq -c
Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ 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+
10+ tail -n +2 ./events-with-timestamps.txt | awk ' { print $3 }' | sort | uniq -c
You can’t perform that action at this time.
0 commit comments