Skip to content

London | 26-SDC-July | Raihan Sharif | Sprint 1 | individual-shell-tools#566

Open
RaihanSharif wants to merge 32 commits into
CodeYourFuture:mainfrom
RaihanSharif:individual-shell-tools
Open

London | 26-SDC-July | Raihan Sharif | Sprint 1 | individual-shell-tools#566
RaihanSharif wants to merge 32 commits into
CodeYourFuture:mainfrom
RaihanSharif:individual-shell-tools

Conversation

@RaihanSharif

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Completed all exercises for individual shell tools

@RaihanSharif RaihanSharif added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 10, 2026
@github-actions

Copy link
Copy Markdown

Results of test:
Failed grep/script-04.sh, please check
Failed grep/script-07.sh, please check
Failed ls/script-04.sh, please check
Failed sed/script-02.sh, please check
Failed sed/script-03.sh, please check
You passed 26/31 tasks.

@SlideGauge SlideGauge left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task is to output 10 lines. Does this script do this?


# -E is extended regex, needed for + (one or more) quantifier
# [[:space:]] is POSIX compliant
sed -E s'/[0-9]+[[:space:]]//g' ./input.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, that the output should be " Alisha", not "Alisha". Space has been lost

# -n prevent default printing behaviour
# ! negates regex match, i.e. gets lines that don't match
# p prints
sed -n ':[0-9]:!p' input.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an address regex must be delimited with /…/, not :…:

# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean capture-group swap with a clear comment explaining each group. Well done on one of the trickier ones.

@SlideGauge SlideGauge added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants