Skip to content

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

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

London | 26-SDC-Mar | Khilola Rustamova| Sprint 1 | Individual shell tools#358
HilolaRustam wants to merge 3 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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

fixed it.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes with "^Doctor:"

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes with "^Doctor:" as well

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, with cat -n

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes, with cat -n

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.

@HilolaRustam HilolaRustam added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

The changed files in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the changed files tab at the top of the page, we are only expecting changes in this directory: ^individual-shell-tools/

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 7, 2026
@SlideGauge
Copy link
Copy Markdown

Good job in addressing my comments, thanks.
At the same time I see you by accident added some files belonging to other task. Could you remove them please?

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