Skip to content

London | 26-SDC-Mar | Khilola Rustamova| Sprint 1 | Individual shell tools#358

Open
HilolaRustam wants to merge 2 commits intoCodeYourFuture:mainfrom
HilolaRustam:individual-shell-tools
Open

London | 26-SDC-Mar | Khilola Rustamova| Sprint 1 | Individual shell tools#358
HilolaRustam wants to merge 2 commits intoCodeYourFuture:mainfrom
HilolaRustam:individual-shell-tools

Conversation

@HilolaRustam
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
  • My changes follow the style guide

Changelist

Individual shell tools exercise is completed

Questions

@HilolaRustam HilolaRustam added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 12, 2026
@SlideGauge SlideGauge added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Apr 5, 2026
# NOTE: This is a stretch exercise - it is optional.

# TODO: Write a command to output just the names of each player along with the total of adding all of that player's scores.
awk '{sum=o; for(i=3; i<=NF; i++) sum+=$i; print $1, sum}' scores-table.txt
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you have a look at how we initialise sum variable? Is it what we really want?

set -euo pipefail

# TODO: Write a command to output the name of every `.txt` file in this directory which contains a line of dialogue said by the Doctor.
grep -l "^Doctor" *.txt
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if our file contained a line like "Doctors:" what will happen? Should we make more precise mask?

set -euo pipefail

# TODO: Write a command to output, for each `.txt` file in this directory, how many lines of dialogue the Doctor has.
grep -c "^Doctor" *.txt
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same here: if our file contained a line like "Doctors:" what will happen? Should we make more precise mask?

set -euo pipefail

# TODO: Write a command to output the contents of the file `helper-3.txt` inside the helper-files directory to the terminal.
cat ../helper-files/helper-3.txt | nl
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we use some cat command line parameters to get the same output?

# NOTE: This is a stretch exercise - it is optional.

# TODO: Write a command to output the contents of all of the files in the helper-files directory to the terminal.
cat ../helper-files/* | nl
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we use some cat command line parameters to get the same output?

set -euo pipefail

# TODO: Write a command to output just the names of each player in London along with the score from their last attempt.
awk '$2 == "London" {print $1, $NF}' scores-table.txt
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice use of NF

@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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Apr 5, 2026
@SlideGauge
Copy link
Copy Markdown

Good job, I've got a couple of notes to address, fix them please and I'll complete the review.

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

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants