Skip to content

London | 26-SDC-Mar | Craig D'Silva | Sprint 2 | Shell Pipelines#395

Open
craig-dsilva wants to merge 4 commits intoCodeYourFuture:mainfrom
craig-dsilva:shell-pipelines
Open

London | 26-SDC-Mar | Craig D'Silva | Sprint 2 | Shell Pipelines#395
craig-dsilva wants to merge 4 commits intoCodeYourFuture:mainfrom
craig-dsilva:shell-pipelines

Conversation

@craig-dsilva
Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes

Changelist

This is the coursework for the Shell pipelines exercise

@craig-dsilva craig-dsilva added 🦑 Size Large 4-8 hours 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Mar 20, 2026
Copy link
Copy Markdown

@SlideGauge SlideGauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add trailing new lines to all the scripts? Doublecheck the settings of your editor, so it will place them automatically.

# 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.

cat events.txt | sort | uniq -c No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It groups by the whole line (person + event type), so the output is 2 Entry German, 1 Entry Mariana, etc. - you have to sum those up yourself to get 5 and 4. The task says it should be clear from the output that there are 5 Entry and 4 Exit events.

# 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.

cat events-with-timestamps.txt | awk '{print $3, $4;}' | grep -v 'Event' | sort | uniq -c No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach will use awk to extract both event and name, thus leading to similar problem as script-06.sh

# 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 -n -r scores-table.txt No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does -k3 without specifying the end key mean and is it what we want here?

# Piotr Glasgow 15 2 25 11 8
# Chandra Birmingham 12 6

sort -k3 -n -r scores-table.txt | head -n 3 No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does -k3 without specifying the end key mean and is it what we want here?

# 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 -n -r scores-table.txt | head -n 2 | tail -n 1 No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does -k3 without specifying the end key mean and is it what we want here?

# 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 '^[A-Z]' | grep -vE '.[A-Z]' No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creative use of piping of greps, like.

@SlideGauge SlideGauge added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels May 3, 2026
@SlideGauge
Copy link
Copy Markdown

Could you apply fixes to the points I described?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 🦑 Size Large 4-8 hours 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants