-
-
Notifications
You must be signed in to change notification settings - Fork 90
London | 26-SDC-Mar | Mariia Serhiienko | Sprint 2 | Shell pipelines #440
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 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 | sort -k2 | ||
|
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. The output produced by your command does not quite match the expected output, which is in the form: |
||
| 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. | ||
| tail -n +2 events-with-timestamps.txt | cut -d' ' -f3 | 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. `cut -d' ' -f3 works only if the fields on each line is separated by EXACTLY one space. |
||
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.
Note:
I was curious and asked AI's which of the following ways of using
headandtailis preferred:head -2 | tail -1head -n 2 | tail -n 1They suggested the 2nd syntax for compatibility and readability reasons.