London |SDC- MARC-2026 | JAMAL LAQDIEM | Sprint 1 | Individual Shell Tolls#335
London |SDC- MARC-2026 | JAMAL LAQDIEM | Sprint 1 | Individual Shell Tolls#335jamallaqdiem wants to merge 18 commits intoCodeYourFuture:mainfrom
Conversation
Added -1 that allow on file by line.
…tart of the line.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| # TODO: Write a command to output the contents of the helper-1.txt file inside the helper-files directory to the terminal. | ||
| # The output of this command should be "Once upon a time...". | ||
| cat helper-files/helper-1.txt No newline at end of file |
There was a problem hiding this comment.
what will happen if we execute this script from the cat folder? (hint, check where's helper-files folder is located relative to cat folder)
There was a problem hiding this comment.
Hi thanks for taking time to review my work, if the script get executed form cat folder will not found the helper-files directory.
As I double checked, the README ask that the script running inside the directory they're saved in. I will address the matter.
|
|
||
| # TODO: Write a command to output every line in dialogue.txt that does not contain the word "Hello" (regardless of case). | ||
| # The output should contain 10 lines. | ||
| grep -vi "hello" dialogue.txt | wc -l No newline at end of file |
There was a problem hiding this comment.
Could you double check what this script outputs? The request is to output lines of dialogue satisfying some criteria
There was a problem hiding this comment.
Hi thanks for taking time to review my work, I just addressed the matter, I should stop at the output, without adding the wc that output the total counts
| # TODO: Write a command to output just the names of each player along with the total of adding all of that player's scores. | ||
| # Your output should contain 6 lines, each with one word and one number on it. | ||
| # The first line should be "Ahmed 15". The second line should be "Basia 37" | ||
| awk '{ total = 0; for (i = 2; i <= NF; i++) total += $i; print $1, total }' scores-table.txt No newline at end of file |
There was a problem hiding this comment.
do we indeed want to start summation from 2 item?
There was a problem hiding this comment.
Thanks for taking time to review my work, no we need to start from i =3, My calculation was based that awk start at index 0, however it start at 1.
|
|
||
| # 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 No newline at end of file |
There was a problem hiding this comment.
What will happen if patient says a line with a word "Doctor"?
There was a problem hiding this comment.
Thanks for taking time to review my work, you're right it will show that line as well, to avoid that I will add the colon and the regex anchor to tell the command to get only the first thing on the line.
| # 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 -1 ./child-directory |
There was a problem hiding this comment.
Thanks for taking time to review my work, there is no need to keep the -1 flag twice, I forgot to delete the second one, thanks.
|
Good direction, I placed some comments, please fix them. Also, could you doublecheck new lines in the end of scripts please? |
I made sure in the setting VsCode , that it will add a new line automatically at save. |
Self checklist
Changelist
Completed all exercises about command lines.