-
-
Notifications
You must be signed in to change notification settings - Fork 42
London | 25-SDC-July | Aung Ye Kyaw | sprint 1 | Individual Shell Tool Exercise #113
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?
Conversation
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.
Hello! Please ensure this PR only contains files for the shell tools exercises.
Please create another PR for the number systems exercise. Creating a separate branch for this will make things easier :)
|
hello! I have created another branch for numbering system . Thanks, |
LonMcGregor
left a comment
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.
Hi, good work on this sprint. There are a few different tasks you need to have another look at, I've left some pointer comments on them
| set -euo pipefail | ||
|
|
||
| # TODO: Write a command to output just the names of each player in London along with the score from their last attempt. | ||
| awk '$2 =="London" {print $1,$5}' scores-table.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.
Will this still work if the player makes more than a few attempts?
| # TODO: Write a command to output the contents of all of the files in the helper-files directory to the terminal. | ||
| # We also want to see the line numbers in the output, but we want line numbers not to reset at the start of each file. | ||
| cd helper-files | ||
| cat helper-1.txt helper-2.txt helper-3.txt | cat -n |
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.
Do you know how to make cat output and number multiple files in a single command?
| set -euo pipefail | ||
|
|
||
| # TODO: Write a command to output the number of lines in dialogue.txt that contain the word Doctor (regardless of case). | ||
| grep -i "Doctor" dialogue.txt | wc -l |
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.
Can you complete this task only using grep in a single command?
| set -euo pipefail | ||
|
|
||
| # TODO: Write a command to output every line in dialogue.txt that does not contain the word "Hello" (regardless of case). | ||
| grep -v "Hello" dialouge.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.
The task is also asking about case insensitivity here - can you update your solution for that?
| 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. | ||
| grep "^Doctor" *.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.
Can you build a single grep command that only shows the filename in the output?
|
|
||
| # TODO: Write a command which does the same as above, but sorted in the opposite order (oldest first). | ||
| cd child-directory | ||
| ls -1t | tail -r |
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.
On my system tail -r does not seem to be a valid command. Can you complete this only using a single ls command?
| set -euo pipefail | ||
|
|
||
| # TODO: Write a command to output input.txt removing any line which contains a number. | ||
| sed '/^[0-9] [[:space]]/d' input.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.
Is it necessary for your regexp to include the [[:space]] test?
|
|
||
|
|
||
| # TODO: Write a command to output input.txt with one change: | ||
| sed 's/^\([0-9][0-9]*\) \(.*\)/\2 \1/' input.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.
Do you need two number groups in your regexp here?
Hi. There!
I would like to thank you for reviewing my exercise.
Kindly check and guide me for my exercise..
Thanks and Regards,
AYK