NW | 2026-mar-sdc | TzeMing Ho | Sprint 1 | individual-shell-tools-exercises#361
NW | 2026-mar-sdc | TzeMing Ho | Sprint 1 | individual-shell-tools-exercises#361TzeMingHo wants to merge 11 commits intoCodeYourFuture:mainfrom
Conversation
SlideGauge
left a comment
There was a problem hiding this comment.
There are a lot of files which do not have the trailing newline. Could you adjust settings of your editor please?
| # TODO: Write a command to output, for each `.txt` file in this directory, how many lines of dialogue the Doctor has. | ||
| # The output should show that dialogue.txt contains 6 lines, dialogue-2.txt contains 2, and dialogue-3.txt contains 0. | ||
|
|
||
| grep -c ^Doctor *.txt No newline at end of file |
There was a problem hiding this comment.
What will happen if we met a line starting like this:
Doctorslike:
?
There was a problem hiding this comment.
Ohh. I see the problem now. If I missed the : after Docter, I will also count DoctersLike: in the lines.
I fixed the command as grep -c ^Doctor: *.txt
|
|
||
| # TODO: Write a command which lists all of the files in the directory named child-directory. | ||
|
|
||
| ls -R ./child-directory |
There was a problem hiding this comment.
What does -R do? Do we need it in this context?
There was a problem hiding this comment.
The -R is for recursive search. We don't need it if we only need to know the files under the name of child-directory.
|
Good job, there a couple of notes from my side, could you fix them? |
Learners, PR Template
Self checklist
Changelist
I have attempted to answer the questions. It was fun, and I learnt many new things.