A minimalistic Unix shell implementation written in C, demonstrating fundamental systems programming concepts and shell functionality.
Tchell is a custom Unix shell implementation that provides a basic command-line interface. This project showcases:
- Systems Programming: Direct interaction with Unix system calls
- Memory Management: Proper allocation and deallocation of resources
- Input Handling: Custom implementation using
get_next_linefunction - Process Management: Understanding of how shells interact with the operating system
This project serves as an educational exercise in understanding how shells work under the hood and demonstrates proficiency in low-level C programming.
- Interactive Command Prompt: Custom prompt (
tcsh !..) for user interaction - Input Processing: Efficient line-by-line input reading using
get_next_line - Modular Design: Clean separation of concerns with dedicated modules:
get_next_line: Custom file reading implementationprintft: Custom printf implementationstrings: String manipulation utilities
- Memory Safe: Proper memory management practices
- Unix Compliant: Follows Unix shell conventions
- GCC or compatible C compiler
- Make build system
- Unix-like operating system (Linux, macOS, etc.)
-
Clone the repository:
git clone https://github.com/fevunge/tchell.git cd tchell -
Build the project:
make
-
Run the shell:
make run # or directly: ./build/tchell
Once started, Tchell presents an interactive prompt where you can enter commands:
tcsh !.. your_command_heremakeormake all- Build the projectmake clean- Remove object filesmake fclean- Remove all generated files including build directorymake re- Rebuild the project from scratchmake run- Build and run the shell
.
βββ Makefile
βββ README.md
βββ src
βββ get_next_line
βΒ Β βββ get_next_line.c
βΒ Β βββ get_next_line.h
βΒ Β βββ get_next_line_utils.c
βΒ Β βββ Makefile
βββ main.c
βββ Makefile
βββ printft
βΒ Β βββ printft_arg.c
βΒ Β βββ printft.c
βΒ Β βββ printft.h
βΒ Β βββ printft_utils.c
βββ strings
βΒ Β βββ strinclude.c
βΒ Β βββ strings.h
βββ tchell.c
βββ tchell.h
- C Language: Core implementation language
- Make: Build system for compilation
- Unix System Calls: For system interaction
- Custom Libraries:
get_next_line: Efficient line readingprintft: Custom formatted outputstrings: String manipulation utilities
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow consistent C coding style
- Ensure memory safety (no leaks, proper cleanup)
- Test your changes thoroughly
- Update documentation as needed
This project is open source. Please check the repository for license details.
Built with β€οΈ and lots of C programming