-
-
Notifications
You must be signed in to change notification settings - Fork 103
Manchester | 26-SDC-Jul | Fithi-Teklom | Sprint 1 | Individual-shell-tools #567
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 all commits
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 |
|---|---|---|
|
|
@@ -11,3 +11,5 @@ set -euo pipefail | |
| # It looked delicious. | ||
| # I was tempted to take a bite of it. | ||
| # But this seemed like a bad idea... | ||
|
|
||
| cat helper-files/* | ||
|
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. helper-files/ is a sibling of these folders, not a child. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,5 @@ set -euo pipefail | |
| # 1 It looked delicious. | ||
| # 2 I was tempted to take a bite of it. | ||
| # 3 But this seemed like a bad idea... | ||
|
|
||
| cat -n helper-files/helper-3.txt | ||
|
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. helper-files/ is a sibling of these folders, not a child. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ set -euo pipefail | |
|
|
||
| # TODO: Write a command to output every line in dialogue.txt said by the Doctor. | ||
| # The output should contain 6 lines. | ||
|
|
||
| grep "Doctor" dialogue.txt | ||
|
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. Does it grabs only lines said by a doctor, not something like "Hello, Doctor!"? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ set -euo pipefail | |
|
|
||
| # 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 | ||
|
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 line is commented, what was intended here to happen? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,11 @@ echo "First exercise (sorted newest to oldest):" | |
| # TODO: Write a command which lists the files in the child-directory directory, one per line, sorted so that the most recently modified file is first. | ||
| # The output should be a list of names in this order, one per line: helper-3.txt, helper-1.txt, helper-2.txt. | ||
|
|
||
| # ls -1t 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. Why is this line commented? |
||
|
|
||
| echo "Second exercise (sorted oldest to newest):" | ||
|
|
||
| # TODO: Write a command which does the same as above, but sorted in the opposite order (oldest first). | ||
| # The output should be a list of names in this order, one per line: helper-2.txt, helper-1.txt, helper-3.txt. | ||
|
|
||
| ls -1tr child-directory | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ set -euo pipefail | |
|
|
||
| # TODO: Write a command to output input.txt replacing every occurrence of the string "We'll" with "We will". | ||
| # The output should contain 11 lines. | ||
|
|
||
| sed "We'll/We will/g" | ||
|
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. How does it know which file to look into? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ set -euo pipefail | |
|
|
||
| # TODO: Write a command to output the number of words in the file helper-files/helper-3.txt. | ||
| # The output should include the number 19. The output should not include the number 92. | ||
|
|
||
| wc -w helper-files/helper-3.txt | ||
|
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. helper-files/ is a sibling of these folders, not a child. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ set -euo pipefail | |
|
|
||
| # TODO: Write a command to output the number of lines in the file helper-files/helper-3.txt. | ||
| # The output should include the number 3. The output should not include the number 19. | ||
|
|
||
| wc -l helper-files/helper-3.txt | ||
|
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. helper-files/ is a sibling of these folders, not a child. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,5 @@ set -euo pipefail | |
| # 1 7 39 ../helper-files/helper-2.txt | ||
| # 3 19 92 ../helper-files/helper-3.txt | ||
| # 5 30 151 total | ||
|
|
||
| wc helper-files/* | ||
|
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. helper-files/ is a sibling of these folders, not a child. |
||
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.
helper-files/ is a sibling of these folders, not a child.