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 - EYAD HUSSEIN #123

Open
13 tasks done
eyad-hussein opened this issue Jun 23, 2024 · 2 comments
Open
13 tasks done

Coreutils - EYAD HUSSEIN #123

eyad-hussein opened this issue Jun 23, 2024 · 2 comments

Comments

@eyad-hussein
Copy link

eyad-hussein 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

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

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

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

  • 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.
@eyad-hussein
Copy link
Author

I was able to implement more than 6 commands, however most of them expect one file/argument other than the flags(if present), i will be working on fixing that tomorrow. In addition I will implement the remaining commands as well.

@eyad-hussein
Copy link
Author

Pull request was made codescalersinternships/Coreutils-EYAD_HUSSEIN#1

Waiting for the review

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

No branches or pull requests

1 participant