Coder Social home page Coder Social logo

minishell_42ad's Introduction

Minishell

Introduction

Minishell is a simple Unix shell implementation written in C. It provides a command-line interface to interact with the operating system, allowing users to execute commands, manage processes, and manipulate files. The project aims to deepen understanding of system calls, process management, and command-line parsing.

Features

  • Command Execution: Execute external commands by forking and calling execve().
  • Built-in Commands: Support for built-in commands such as cd, echo, pwd, export, unset, and env.
  • Input/Output Redirection: Handle input/output redirection (<, >, >>) and piping (|) between commands.
  • Environment Variables: Manage environment variables, including setting, getting, and removing them.
  • Signal Handling: Handle signals such as Ctrl+C (SIGINT) and Ctrl+\ (SIGQUIT) gracefully.
  • Error Handling: Provide informative error messages for invalid commands, syntax errors, and exceptional conditions.

Project Structure

The Minishell project typically consists of the following components:

.
├── Env : Environment-related files.
├── Libft : Library containing utility functions (if used).
├── Parsing : Files related to command-line parsing.
├── Signals : Signal handling related files.
├── Makefile : Makefile for building the project.
├── main.c Main source file containing the entry point of the program.
├── README.md : Project documentation.
└── minishell.h : Header file containing function prototypes and constant definitions.

Installation

To build Minishell, follow these steps:

  1. Clone the repository:

    git clone <repository_url>
  2. Navigate to the project directory:

    cd minishell
  3. Compile the program using the provided Makefile:

    make

Usage

To run Minishell, execute the following command:

./minishell

This will start the Minishell prompt, where you can enter commands and interact with the shell. Use built-in commands or external commands as needed.

Example:

$ ./minishell
minishell> ls -l
total 72
-rw-r--r-- 1 user user   432 Jan  1 10:00 README.md
-rwxr-xr-x 1 user user 48576 Jan  1 10:00 minishell
...
minishell> exit
$

Contributing

Contributions to the Minishell project are welcome! If you have any ideas, enhancements, or bug fixes, feel free to open an issue or submit a pull request.

minishell_42ad's People

Contributors

legaliab avatar shamzaou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.