London | 26-SDC-July | Raihan Sharif | Sprint 1 | individual-shell-tools#566
London | 26-SDC-July | Raihan Sharif | Sprint 1 | individual-shell-tools#566RaihanSharif wants to merge 38 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
SlideGauge
left a comment
There was a problem hiding this comment.
Good job, I got just a couple of comments from my side, fix them please.
|
|
||
| # 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 |
There was a problem hiding this comment.
Right now the script targets the current dir. Is that what we're asked for?
|
|
||
| # 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 | grep . No newline at end of file |
There was a problem hiding this comment.
The task is to output 10 lines. Does this script do this?
There was a problem hiding this comment.
No it does not.
Fixed by removing the pipe into grep . which was intended to filter out the blank line.
|
|
||
| # -E is extended regex, needed for + (one or more) quantifier | ||
| # [[:space:]] is POSIX compliant | ||
| sed -E s'/[0-9]+[[:space:]]//g' ./input.txt |
There was a problem hiding this comment.
Note, that the output should be " Alisha", not "Alisha". Space has been lost
There was a problem hiding this comment.
Fixed now. I should have read the requirement more carefully.
| # space after number is part of the pattern but not the group | ||
| # 2 is everything else | ||
| # then print out group 2, a space, and then group 1 | ||
| sed -E 's/^([0-9]+) (.*)/\2 \1/' input.txt |
There was a problem hiding this comment.
Clean capture-group swap with a clear comment explaining each group. Well done on one of the trickier ones.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0a60e4d to
31e3fac
Compare
|
Results of test: |
Learners, PR Template
Self checklist
Changelist
Completed all exercises for individual shell tools