Repository navigation
Add sorting and unique filtering commands #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,5 @@ set -euo pipefail | |
| # The input for this script is the scores-table.txt file. | ||
| # TODO: Write a command to output scores-table.txt, with shows the line for the player whose first score was the second highest. | ||
| # Your output should be: "Piotr Glasgow 15 2 25 11 8" (without quotes). | ||
|
|
||
| sort -k3,3nr scores-table.txt | head -n 2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous file, this line is pure code with no extra comment. That’s usually a good sign that you’re letting the code speak for itself. As you keep practicing, you might reflect on whether commands like To "like" or "dislike" this comment, please follow this link |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,5 @@ set -euo pipefail | |
| # TODO: Write a command to show a list of all events that have happened, without duplication. | ||
| # The order they're displayed doesn't matter, but we never want to see the same event listed twice. | ||
| # Your output should contain 6 lines. | ||
|
|
||
| uniq events.txt | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here as well, there is no new comment, only the To "like" or "dislike" this comment, please follow this link |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new line you added here is code only, with no comment. Since this review is focused on comments that might not add much value, there’s nothing to improve on this particular change. When you do add comments in the future, it can be useful to ask yourself: “Would this still be helpful to someone who already understands basic shell tools like
sort?” If the answer is no, the code might be clear enough on its own.To "like" or "dislike" this comment, please follow this link