Skip to content

London | 26-SDC-Mar | Beko | Sprint 1 | Individual shell tools exercises#352

Open
Abubakar-Meigag wants to merge 1 commit intoCodeYourFuture:mainfrom
Abubakar-Meigag:beko-individual-shell-tools
Open

London | 26-SDC-Mar | Beko | Sprint 1 | Individual shell tools exercises#352
Abubakar-Meigag wants to merge 1 commit intoCodeYourFuture:mainfrom
Abubakar-Meigag:beko-individual-shell-tools

Conversation

@Abubakar-Meigag
Copy link
Copy Markdown
Contributor

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

complete individual shell tools exercises

Questions

no questions, thanks!

@github-actions

This comment has been minimized.

@Abubakar-Meigag Abubakar-Meigag added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 11, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 11, 2026
@Abubakar-Meigag Abubakar-Meigag added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 11, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 11, 2026
@Abubakar-Meigag Abubakar-Meigag changed the title London | 26-SDC-Mar | Beko | Sprint1 | Individual shell tools exercises London | 26-SDC-Mar | Beko | Sprint 1 | Individual shell tools exercises Mar 11, 2026
@Abubakar-Meigag Abubakar-Meigag added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 1 Assigned during Sprint 1 of this module Module-Tools The name of the module. labels Mar 11, 2026
Copy link
Copy Markdown

@SlideGauge SlideGauge left a comment

Choose a reason for hiding this comment

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

There a couple of files which do not have empty line in the end of the file (like wc/script-02.sh). Could you add them please


set -euo pipefail

awk '{print NF}' scores-table.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.

What does NF mean in this context and what will this line output?


set -euo pipefail

awk '/London/ {print $1, $4}' scores-table.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.

What happens when we meet lines with different number of scores?

set -euo pipefail


grep -v "Hello" dialogue.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.

Will it find lines like "hello" (lowercase)?

# TODO: Write a command to list the files and folders in this directory.
# The output should be a list of names including child-directory, script-01.sh, script-02.sh, and more.

ls ../ls
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

README file says
"You should write all of your scripts assuming they're running inside the directory they're saved in."
Whilst this line works, it does redundant operation with the path, could you simplify it?

# TODO: Write a command which lists all of the files in the directory named child-directory.
# The output should be a list of names: helper-1.txt, helper-2.txt, helper-3.txt.

ls ../ls/child-directory 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.

README file says
"You should write all of your scripts assuming they're running inside the directory they're saved in."
Whilst this line works, it does redundant operation with the path, could you simplify it?


echo "First exercise (sorted newest to oldest):"

ls -t ../ls/child-directory
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

README file says
"You should write all of your scripts assuming they're running inside the directory they're saved in."
Whilst this line works, it does redundant operation with the path, could you simplify it?

# The output should be a list of names including: child-directory, script-01.sh, helper-1.txt (and more).
# The formatting of the output doesn't matter.

ls ../ls ../ls/child-directory 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.

Also, will it output directories contents recursively?


set -euo pipefail

grep -l "Doctor:" *.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.

Will it output only lines of the Doctor or can it potentially output lines which contain "Doctor:" somewhere in the middle?


set -euo pipefail

awk '/London/ {print $1, $4}' scores-table.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.

What will happen if some of the player's have name "London" but the city is not London?


set -euo pipefail

awk '{for (i=3; i<=NF; i++) sum[$1] += $i} END {for (name in sum) print name, sum[name]}' scores-table.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.

Does for (name in sum) guarantee the order of traversal?

@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 Mar 31, 2026
@SlideGauge
Copy link
Copy Markdown

Wrote my notes, could you fulfil them please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants