Code Monkey home page Code Monkey logo

minishell's Introduction

Minishell - 42 School Project

Description

Minishell is a simplified shell program developed as part of the 42 school curriculum. It is designed to understand and execute basic shell commands, handle environment variables, and manage processes.

Table of Contents

Features

  • Command execution
  • Redirection and pipes
  • Environment variable support
  • Signal handling
  • Basic error handling

Getting Started

Prerequisites

  • GCC compiler
  • Make
  • libft (your personal library or the school's standard library)

Installation

  1. Clone the repository:
    git clone https://github.com/Vaache/minishell.git
    cd minishell
  2. Build the project:
    make readline; make

Usage:

  1. Run the Minishell executable:
     ./minishell
    

Command Examples

  1. Execute a command:
    ls -l
    
  2. Redirect output to a file:
    ls > output.txt
    
  3. Use pipes:
    ls -l | grep .txt
    

Built-in Commands

Minishell supports the following built-in commands:

  • echo
  • cd
  • pwd
  • export
  • unset
  • env
  • exit

Bonus

Additional Features Command Line Editing: Add line editing capabilities with features like history, arrow key navigation, and editing. Tab Completion: Support tab completion for commands and file paths.

Logical Operators

    • && and ||: Implement the logical operators && and || to allow chaining of commands based on the success or failure of previous commands.
    command1 && command2  # Execute command2 only if command1 succeeds
    command1 || command2  # Execute command2 only if command1 fails
    

Command Grouping

  1. Command Grouping with (): Allow command grouping using parentheses to change the precedence of execution.
    (command1 && command2) || command3
    

Testing

Include comprehensive test cases to ensure the correctness and robustness of your shell. Use a test suite or framework to automate testing. Performance Optimization Optimize the performance of your shell, especially for handling large inputs and executing complex commands. This section suggests the addition of logical operators && and || for command chaining based on success or failure and the use of parentheses for command grouping to change the precedence of execution. Feel free to further customize or expand this section based on specific implementation details or additional features you've included in your Minishell project.

minishell's People

Contributors

vaache avatar ruzomkrtchyan avatar

Stargazers

 avatar  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.