-
-
Notifications
You must be signed in to change notification settings - Fork 88
Birmingham | 26-SDC-Mar | Chioma Okeke | Sprint 2 | Shell Pipelines #404
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,4 @@ set -euo pipefail | |
| # The input for this script is the scores-table.txt file. | ||
| # TODO: Write a command to output scores-table.txt, with lines sorted by the person's first score, descending. | ||
| # The first line of your output should be "Basia London 22 9 6" (with no quotes). | ||
| sort -k3 -nr ./scores-table.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. what is the meaning of -k3 without additional argument and is that what we want here? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,5 @@ set -euo pipefail | |
| # Basia London 22 9 6 | ||
| # Piotr Glasgow 15 2 25 11 8 | ||
| # Chandra Birmingham 12 6 | ||
| sort -k3 -n ./scores-table.txt | tail -r -n3 | ||
|
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. tail -r is a macOS/BSD-only flag — it doesn't exist in GNU tail (Linux) 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. what is the meaning of -k3 without additional argument and is that what we want here? |
||
| # sort -k3 -nr ./scores-table.txt | head -n3 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ 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 -nr ./scores-table.txt | head -n2 | tail -n1 | ||
|
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. what is the meaning of -k3 without additional argument and is that what we want here? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ set -euo pipefail | |
| # TODO: Write a command to show how many times anyone has entered and exited. | ||
| # It should be clear from your script's output that there have been 5 Entry events and 4 Exit events. | ||
| # The word "Event" should not appear in your script's output. | ||
| grep -o 'Entry\|Exit' ./events-with-timestamps.txt | sort | uniq -c | ||
|
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. Nice use of grep |
||
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.
'^[A-Z][^A-Z]*$' is the precise regex for "no other uppercase characters" regardless of what else is in the filename. Like