-
-
Notifications
You must be signed in to change notification settings - Fork 88
NW | 2026-mar-sdc | TzeMing Ho | Sprint 1 | individual-shell-tools-exercises #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 8 commits
e7349bf
9d202d2
e026f28
709bd7d
19b4517
e830b6e
bd5707e
5a924f0
8598be5
290e627
ea4fd85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,6 @@ | |
| set -euo pipefail | ||
|
|
||
| # 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does -R do? Do we need it in this context?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| # The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if we met a line starting like this:
Doctorslike:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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