Skip to content
Tothan1Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

250 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by lverschu, tle-rhun

DESCRIPTION

The goal of the Minishell project is to recreate a simpler version of the bash program using bash --posix as a reference.

The subject states that we must :

  • Display an unspecified prompt when waiting for a new command.
  • Have a working history.
  • Search/launch the correct executable using whether the relative or absolute path.
  • Handle single quotes (' ') and double quotes (" ") correctly.
  • Have working redirects (< infile, > outfile, << heredoc, >> append).
  • Handle pipes ( | ), which use is to use the previous command output as the input for the next command.
  • Have a working expander for environmental variables (ex : echo $USER), as for $? which store the previous exit status.
  • Have signals as ctrl-C, ctrl-D, *ctrl-* behaving the same as in bash --posix

However we shall not interpret \ (backslash), ; (semicolon), or anykind of special character, nor unclosed quotes.

Basic built-ins

We also must write our own built-ins for some functions.

  • echo with an enventual -n.
  • cd (with absolute or relative path).
  • pwd with no options.
  • export with no options.
  • unset with no options.
  • env with no options or arguments.
  • exit with no options.

We must of course never have leaks of any kinds, with the exception of the readline command which we suppress using a special make val.

INSTRUCTIONS

In order to launch Minishell you must first use the git clone command.

Then in the root directory you can use all the mandatory make command :

  • make
  • make clean
  • make fclean
  • make re

We also implemented our own like :

  • make good, which consists of make && make clean, so that we do not have all the *.o files.
  • make val, which launch our Minishell with all the Valgrind flags we may need.

RESOURCES

For the parsing the main source was the bash itself, testing directly is way faster than looking for the answer online.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages