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

Coreutils - Template #105

Open
xmonader opened this issue Jun 23, 2024 · 0 comments
Open

Coreutils - Template #105

xmonader opened this issue Jun 23, 2024 · 0 comments
Labels
task New task

Comments

@xmonader
Copy link
Member

xmonader commented Jun 23, 2024

CoreUtils in Go

Description

Goal is to reimplement several core Unix utilities. giving exposure to Go basics, including file I/O, flag parsing, string manipulation, and more.

Requirements

  1. Create Go programs that replicate the functionality of the following Unix utilities:

    • head
    • tail
    • wc (word count)
    • cat
    • echo
    • tree
  2. Each utility should be implemented as a separate Go program.

  3. Programs should read input from files or stdin as appropriate.

  4. Implement basic flags for each utility where applicable.

Example Implementations

1. head

  • Print the first 10 lines of input by default.
  • Add a -n flag to specify the number of lines to print.

2. tail

  • Print the last 10 lines of input by default.
  • Add a -n flag to specify the number of lines to print.

3. wc (word count)

  • Count lines, words, and characters in the input.
  • Add -l, -w, and -c flags to display only lines, words, or characters respectively.

4. cat

  • Concatenate and print files.
  • Add a -n flag to number output lines.

5. echo

  • Print arguments to standard output.
  • Add a -n flag to omit the trailing newline.

Acceptance Criteria

  • Each utility is implemented as a separate Go program.
  • Includes basic error handling.
  • Includes a README with build and usage instructions for all utilities.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task New task
Projects
None yet
Development

No branches or pull requests

2 participants