London| 2026-MAR-SDC | Imran Mohamed | Sprint 2 | Shell pipelines#384
Open
i786m wants to merge 3 commits intoCodeYourFuture:mainfrom
Open
London| 2026-MAR-SDC | Imran Mohamed | Sprint 2 | Shell pipelines#384i786m wants to merge 3 commits intoCodeYourFuture:mainfrom
i786m wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
SlideGauge
reviewed
May 2, 2026
| # The input for this script is the events.txt file. | ||
| # 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. | ||
| sort events.txt | uniq -c No newline at end of file |
There was a problem hiding this comment.
This command groups by the full line, so the output is per-person counts: 2 Entry German, 1 Entry Mariana, 2 Entry Sally, etc. The task says "it should be clear from your script's output that there have been 5 Entry events and 4 Exit events" - a reader has to sum the numbers mentally to get there. You need to count by event type only.
| # 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. | ||
| sort events-with-timestamps.txt | uniq -c | grep -v "Event" |
There was a problem hiding this comment.
Because every timestamp+person combination in events-with-timestamps.txt is unique, sort | uniq -c just outputs every line with a count of 1 - it doesn't aggregate Entry vs Exit.
|
Could you address my comments please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self checklist
Changelist
Added commands for shell pipelines exercises