Skip to content
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

Add exercises for individual shell tools and shell pipelines #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

illicitonion
Copy link
Member

@illicitonion illicitonion commented Nov 25, 2024

Achieving these exercises meets all of the shell tools learning objectives of the first two sprints.

Sample solutions can be seen in the HEAD commit of https://github.com/CodeYourFuture/Module-Tools/tree/individual-shell-tools-solutions (currently d827a5e)

@illicitonion illicitonion force-pushed the individual-shell-tools branch 4 times, most recently from 047b001 to be397fb Compare November 27, 2024 09:50
@illicitonion illicitonion changed the title Add exercises for individual shell tools Add exercises for individual shell tools and shell pipelines Nov 27, 2024
Copy link

@40thieves 40thieves left a comment

Choose a reason for hiding this comment

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

I've only done the individual-shell-tools so far - since I wanted to get the feedback quicker and that's the only bit that's been merged on the curriculum - but it's looking good! Left a few comments about typos and minor suggestions.

individual-shell-tools/grep/script-01.sh Show resolved Hide resolved
individual-shell-tools/cat/script-04-stretch.sh Outdated Show resolved Hide resolved
individual-shell-tools/README.md Show resolved Hide resolved
individual-shell-tools/sed/script-01.sh Outdated Show resolved Hide resolved
individual-shell-tools/sed/script-01.sh Outdated Show resolved Hide resolved
individual-shell-tools/README.md Outdated Show resolved Hide resolved
individual-shell-tools/sed/script-04.sh Outdated Show resolved Hide resolved
individual-shell-tools/grep/script-07.sh Outdated Show resolved Hide resolved
individual-shell-tools/awk/script-01.sh Outdated Show resolved Hide resolved
individual-shell-tools/awk/script-02.sh Outdated Show resolved Hide resolved
illicitonion and others added 6 commits December 16, 2024 17:49
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Copy link

@40thieves 40thieves left a comment

Choose a reason for hiding this comment

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

LGTM :shipit: Oh wait, sorry I forgot about the other commands - will review those now.

Copy link

@40thieves 40thieves left a comment

Choose a reason for hiding this comment

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

A couple more comments/suggestions about the jq & shell-pipelines exercises, but looking pretty good!

jq/script-02.sh Outdated
Comment on lines 6 to 7
# TODO: Write a command to output the name of the person, then a comma, then their profession.
# Your output should be exactly the string "Selma, Software Engineer", but should not contain any quote characters.

Choose a reason for hiding this comment

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

This one feels like a bit of an outlier in terms of difficulty.

I came up with jq -r '[ .name, .profession ] | join(", ")' fwiw. But I see you used escapes within a string.

I think I see what you're going for with multiple selects but I wonder if at this stage it would be best to build an array instead of a string? That would avoid the need for escapes or join functions.

However, I do see that we're using join in the immediate next exercise - and that doesn't feel too far outside to difficulty curve for me - so perhaps this is fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I swapped the order of this and the next one (which is a "pipe to join" exercuse), and added your join as an alternate sample solution, WDYT?

jq/script-09.sh Show resolved Hide resolved
shell-pipelines/ls-grep/script-04.sh Show resolved Hide resolved
shell-pipelines/sort-uniq-head-tail/script-01.sh Outdated Show resolved Hide resolved
illicitonion and others added 3 commits December 23, 2024 14:32
Co-authored-by: Alasdair Smith <alasdairsmith100@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants