Minishell - As beautiful as a shell
This project is about creating a fully functional shell from scratch, which should behave like bash, just with less features. This was a group project consisting of @mottjes and @me.
-
Executable Search: Minishell can execute the appropriate executable with a relative and a absolute path
-
Signal Handling: Only one global variable is used to indicate received signals. This maintains the integrity of our main data structures.
-
Ctrl-C, Ctrl-D, Ctrl-\ Handling: The shell behaves like bash with respect to these keyboard shortcuts:
- Ctrl-C: Displays a new prompt on a new line.
- Ctrl-D: Exits the shell.
- Ctrl-: No action taken.
-
Command History
-
Quoting: Minishell handles single quotes ('), preventing the interpretation of metacharacters within the quoted sequence. Double quotes (") do the same, except for the dollar sign ($).
-
Redirections: The shell supports various redirections:
<redirects input.>redirects output.<<reads input until a specified delimiter, without updating history.>>redirects output in append mode.
-
Pipes: Our shell implements pipes (
|), to get output from one command to the input of the next. -
Environment Variables: Minishell handles environment variables ($ followed by characters), expanding them to their corresponding values.
-
Exit Status:
$?expands to the exit status of the most recently executed foreground pipeline. -
Built-in Commands: Minishell supports the following built-in commands:
echowith the-noptioncdwith relative or absolute pathspwdwith no optionsexportwith no optionsunsetwith no optionsenvwith no options or argumentsexitwith no options
For more detail: The subject pdf is inside of the project folder.
Follow these steps to set up and run Minishell on your system:
-
Clone the Repository:
git clone https://github.com/yourname/minishell.git
-
Navigate to the Directory:
cd minishell -
Compile the Code: Ensure you have
makeandgccinstalled on your system.make
-
Launch the Executable:
./minishell