Skip to content

Barcelona | Oct-2025 | Angela Onyekwelu |Module-Tools|Sprint 3| implement-shell-tools#5

Open
theangelskies wants to merge 12 commits intomainfrom
sprint-3/IST-exercise
Open

Barcelona | Oct-2025 | Angela Onyekwelu |Module-Tools|Sprint 3| implement-shell-tools#5
theangelskies wants to merge 12 commits intomainfrom
sprint-3/IST-exercise

Conversation

@theangelskies
Copy link
Copy Markdown
Owner

Learners, PR Template

Self checklist

  • I have titled my PR with Barcelona | Oct-2025 | Angela Onyekwelu |Module-Tools|Sprint 3| implement-shell-tools
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

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.

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.

1 participant