Giter Site home page Giter Site logo

42.minishell's Introduction

42.Minishell

About

Instructions

  • You must program a mini UNIX command interpreter.
  • This interpreter must display a prompt (a simple $> for example) and wait till you type a command line, validated by pressing enter.
  • The prompt is shown again only once the command has been completely executed.
  • The command lines are simple, no pipes, no redirections or any other advanced functions.
  • The executable are those you can find in the paths indicated in the PATH variable.
  • In cases where the executable cannot be found, it has to show an error message and display the prompt again.
  • You must manage the errors without using errno, by displaying a message adapted to the error output.
  • You must deal correctly with the PATH and the environment (copy of system char **environ).
  • You must implement a series of builtins:
    • exit
    • echo
    • cd
    • env
      • setenv
      • unsetenv
  • You can choose as a reference whatever shell you prefer.
  • You must manage expansions $ and ~

Allowed Functions

  • malloc, free
  • access
  • open, close, read, write
  • opendir, readdir, closedir
  • getcwd, chdir
  • stat, lstat, fstat
  • fork, execve
  • wait, waitpid, wait3, wait4
  • signal, kill
  • exit

Project Structure

Source files

src/
├── builtins
│   ├── builtins.c
│   ├── cmd
│   │   ├── baguette.c
│   │   ├── cd.c
│   │   ├── echo.c
│   │   ├── env.c
│   │   ├── exit.c
│   │   ├── help.c
│   │   ├── konami.c
│   │   └── setenv.c
│   └── get_total.c
├── main.c
├── main.o
├── minishell.c
└── utils
    └── ft_error.c

3 directories, 14 files

Header files

includes/
├── builtins.h
├── minishell.h
└── utils.h

0 directories, 3 filess

Sources

42.minishell's People

Contributors

jraleman avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

42.minishell's Issues

cd - && cd ~/...

The cd builtin function should have the following behavior

image

  • When cd -, call cmd_pwd
  • When cd ~/name-of-path, should go to said path

leeeaaaaaks

this is why i failed hard lol

fix this asap!!

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.