Skip to content
/ fresh Public

A minimalistic Unix shell implementation written in C, demonstrating fundamental systems programming concepts and shell functionality.

Notifications You must be signed in to change notification settings

fevunge/fresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fresh

A minimalistic Unix shell implementation written in C, demonstrating fundamental systems programming concepts and shell functionality.

About

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_line function
  • 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.

✨ Features

  • 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 implementation
    • printft: Custom printf implementation
    • strings: String manipulation utilities
  • Memory Safe: Proper memory management practices
  • Unix Compliant: Follows Unix shell conventions

Prerequisites

  • GCC or compatible C compiler
  • Make build system
  • Unix-like operating system (Linux, macOS, etc.)

Installation

  1. Clone the repository:

    git clone https://github.com/fevunge/tchell.git
    cd tchell
  2. Build the project:

    make
  3. Run the shell:

    make run
    # or directly:
    ./build/tchell

🎯 Usage

Once started, Tchell presents an interactive prompt where you can enter commands:

tcsh !.. your_command_here

Available Make Targets

  • make or make all - Build the project
  • make clean - Remove object files
  • make fclean - Remove all generated files including build directory
  • make re - Rebuild the project from scratch
  • make run - Build and run the shell

πŸ“ Project Structure

.
β”œβ”€β”€ 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

πŸ›  Technologies Used

  • C Language: Core implementation language
  • Make: Build system for compilation
  • Unix System Calls: For system interaction
  • Custom Libraries:
    • get_next_line: Efficient line reading
    • printft: Custom formatted output
    • strings: String manipulation utilities

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow consistent C coding style
  • Ensure memory safety (no leaks, proper cleanup)
  • Test your changes thoroughly
  • Update documentation as needed

πŸ“ License

This project is open source. Please check the repository for license details.

πŸ“ž Contact

GitHub


Built with ❀️ and lots of C programming

About

A minimalistic Unix shell implementation written in C, demonstrating fundamental systems programming concepts and shell functionality.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published