Skip to content

GreenPG/MiniCoque

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minishell

Minishell

Project

Minishell is one of the two project in the 42 program fourth circle. This is the first group project of the 42 common core program. In this projects the students need to create their own shell basec on sh.

Involved Language(s)

  • C_Logo
  • Constraints

    According to the subject there only one constraint for this project:

    • The whole files of the projects need to follow 42 norm [Link]

    External Functions Allowed

    Here are the external functions allowed for this project:

    • readline
    • rl_clear_history
    • rl_on_new_line
    • rl_replace_line
    • rl_redisplay
    • add_history
    • printf
    • malloc
    • free
    • write
    • access
    • open
    • read
    • close
    • fork
    • wait
    • waitpid
    • wait3
    • wait4
    • signal
    • sigaction
    • sigemptyset
    • sigaddset
    • kill
    • exit
    • getcwd
    • chdir
    • stat
    • lstat
    • fstat
    • unlink
    • execve
    • dup
    • dup2
    • pipe
    • opendir
    • readdir
    • closedir
    • strerror
    • perror
    • isatty
    • ttyname
    • ttyslot
    • ioctl
    • getenv
    • tcsetattr
    • tcgetattr
    • tgetent
    • tgetflag
    • tgetnum
    • tgetstr
    • tgoto
    • tputs

    Project breakdown

    Our group splitted the workload in 2 parts:

    • The input parsing handled by GreenPG.
    • The remainings features (creation and/or execution of commands, signal management, etc.) was handled by myself.

    Mandatory Features

    In the following array a list of the features requested by the subject:

    Name Descripion status
    Prompt Display a prompt when waiting for a new command
    History Have a working input history
    PATH Search and launch the right executable (based on the PATH variable or using a relative or an absolute path).
    ' Handle single quote
    " Handle double quote
    | The output of each command in the pipeline is connected to the input of the next command via a pipe.
    Env Variable Handle environment variables ($ followed by a sequence of characters) which should expand to their values.
    $? Have a working input history
    Redirections
    < Should redirect input.
    << Should redirect output.
    > Should be given a delimiter, then read the input until a line containing the delimiter is seen. However, it doesn’t have to update the history!
    >> Should redirect output in append mode.
    Signaux
    ctrl-C Displays a new prompt on a new line.
    ctrl-D Exits the shell.
    ctrl-\ Does nothing.
    Builtins
    echo echo with option -n
    cd cd with only a relative or absolute path
    pwd pwd with no options
    export export with no options
    unset unset with no options
    env env with no options or arguments
    exit exit with no options

    Bonus Features

    In the following array a list of the bonus features requested by the subject:

    Name Descripion status
    && With parenthesis for priorities.
    || With parenthesis for priorities
    Wildcards Should work for the current working directory.

    Usage

    make to compile.

    clean to clean all compiled file without the library file.

    fclean to clean all compiled file with the library file.

    re to fclean then make.

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages

    • C 96.4%
    • Makefile 3.6%