-
-
Notifications
You must be signed in to change notification settings - Fork 88
Glasgow | 26-SDC-Mar | Mohammed Abdoon | Sprint 1 | Individual Shell Tools #336
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 6 commits
6a20de2
c417e0a
aa9527c
8a046bd
f741bea
8cd1dcc
c104cd4
5cae952
500f810
4856862
0fea450
53622a5
5cc9bee
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 |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ set -euo pipefail | |
|
|
||
| # TODO: Write a command to output every line in dialogue.txt that contains the string "cure", as well as the line before that line. | ||
| # The output should contain two pairs of two lines of text (with a separator between them). | ||
| grep -B1 "cure" 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 the task request to process all dialogue files?
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. No, only the dialogue file. I deleted the * from the filename. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ 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. | ||
| # The output should contain two filenames. | ||
| grep -l "^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. Correct use of ^Doctor, like!
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. Thanks ^^ |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ 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. Do doctor lines start from "doctor:"?
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. They actually start with Doctor not doctor. updated it. |
||
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.
Will this command produce lines said only by doctor? Hint: doctor lines start from "Doctor:"
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.
No, I should have specified the lines that start with the word Doctor. I updated it.