London | 26-SDC-Mar | Khilola Rustamova| Sprint 1 | Individual shell tools#358
London | 26-SDC-Mar | Khilola Rustamova| Sprint 1 | Individual shell tools#358HilolaRustam wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
| # 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Same here: if our file contained a line like "Doctors:" what will happen? Should we make more precise mask?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
|
Good job, I've got a couple of notes to address, fix them please and I'll complete the review. |
|
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: 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. |
|
Good job in addressing my comments, thanks. |
Learners, PR Template
Self checklist
Changelist
Individual shell tools exercise is completed
Questions