Barcelona | Oct-2025 | Angela Onyekwelu |Module-Tools|Sprint 3| implement-shell-tools#5
Open
theangelskies wants to merge 12 commits intomainfrom
Open
Barcelona | Oct-2025 | Angela Onyekwelu |Module-Tools|Sprint 3| implement-shell-tools#5theangelskies wants to merge 12 commits intomainfrom
theangelskies wants to merge 12 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
This PR implements custom versions of several common Unix shell tools as part of the shell tools exercise: cat, ls, and wc, using Node.js.
The goal of the work was to replicate the core behaviour of these commands as closely as possible, focusing on both correctness and familiarity with command-line tooling.
The cat implementation supports reading one or multiple files and includes optional flags for line numbering (-n) and numbering non-empty lines only (-b). It correctly handles file input and formats output in a way that mirrors standard cat behaviour.
The ls implementation provides directory listing functionality, supporting the -1 flag for single-column output and the -a flag for displaying hidden files. It reads directory contents using Node’s filesystem module and formats output to match typical Unix-style listing behaviour.
The wc implementation reproduces word, line, and byte counting functionality. It supports individual flags (-l, -w, -c), combined usage, and multiple file inputs with aggregated totals. It processes file content accurately using string and buffer operations.
Across all tools, Node.js built-in modules such as fs and process.argv were used for file system access and command-line argument parsing. While these implementations require execution via Node (e.g. node cat.js file.txt), they successfully replicate the expected behaviour of standard Unix tools within the constraints of the exercise.
Questions
Ask any questions you have for your reviewer. You must remove this section if you have no questions.