-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
LONDON | DONARA BLANC | MODULE TOOLS | SPRINT 2| SHELL PIPELINES #43
base: main
Are you sure you want to change the base?
Conversation
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.
Looking good! I left a few comments - also the general shell script comments from #44 apply here too :)
@@ -4,3 +4,11 @@ set -euo pipefail | |||
|
|||
# TODO: Write a command to output the names of the files in the sample-files directory whose name starts with an upper case letter and doesn't contain any other upper case letters. | |||
# Your output should contain 7 files. | |||
ls sample-files | grep -E '^[A-Z][^A-Z]*$' |
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.
What does the -E
do here? Why do you need it here when you didn't need it for script-02 which otherwise looks quite similar?
@@ -5,3 +5,11 @@ 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 -nrk3 scores-table.txt |
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.
This works, but personally I tend to separate out flags which take values to make it more clear which values are associated with which flag, i.e. I would probably write sort -nr -k3 scores-table.txt
or sort -n -r -k3 scores-table.txt
just to make it a little more clear the 3 is attached to the -k
:)
@@ -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. | |||
tail -9 events-with-timestamps.txt | sort -k3 | awk '{print $3}' | uniq -c |
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.
This works, but I probably would've started it with head -n+2
rather than tail -9
- can you think about why that is? What's the difference between the two?
@@ -7,3 +7,14 @@ set -euo pipefail | |||
# so every Y should be a Z, and every Z should be a Y! | |||
# | |||
# TODO: Write a command to output the contents of text.txt with every Y and Z swapped (both upper and lower case). | |||
Dear Zara, |
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.
I think the command is missing here? Can you add it?
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.