Skip to content

This project was developed in pair-programming with my dearest friend (carologata). It's about creating a simple shell. Yes, our own little bash.

Notifications You must be signed in to change notification settings

bbazaglia/42-minishell

Repository files navigation

🐚 minishell

💡 About the project

The objective of this project is to mimic the operation of bash with specific commands.

📝 Requirements

Mandatory part:

• Display a prompt when waiting for a new command.

• Have a working history.

• Search and launch the right executable (based on the PATH variable or using a relative or an absolute path).

• Not interpret unclosed quotes or special characters which are not required by the subject such as \ (backslash) or ; (semicolon).

• Handle ’ (single quote) which should prevent the shell from interpreting the metacharacters in the quoted sequence.

• Handle " (double quote) which should prevent the shell from interpreting the metacharacters in the quoted sequence except for $ (dollar sign).

• Implement redirections (< , > , << , >>)

• Implement pipes (| character). The output of each command in the pipeline is connected to the input of the next command via a pipe.

• Handle environment variables ($ followed by a sequence of characters) which should expand to their values.

• Handle $? which should expand to the exit status of the most recently executed foreground pipeline.

• Handle ctrl-C, ctrl-D and ctrl-\ which should behave like in bash.

• Your shell must implement the following builtins:

◦ echo with option -n

◦ cd with only a relative or absolute path

◦ pwd with no options

◦ export with no options

◦ unset with no options

◦ env with no options or arguments

◦ exit with no options

Bonus part:

• && and || with parenthesis for priorities.

📋 Testing

To compile, go to the project path and run:

$ make 

Then, execute the program.

$ ./minishell 

Disclaimer: The main purpose of this repository is to expose my code and help other students to understand what was done in each function. Therefore, this work should be used for academic reasons, by those who aim to learn, and not merely copy.

About

This project was developed in pair-programming with my dearest friend (carologata). It's about creating a simple shell. Yes, our own little bash.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published