https://github.com/abdelbenamara/minishell
42 minishell project
https://github.com/abdelbenamara/minishell
2023 42 c makefile minishell
Last synced: 11 months ago
JSON representation
42 minishell project
- Host: GitHub
- URL: https://github.com/abdelbenamara/minishell
- Owner: abdelbenamara
- Created: 2023-07-30T16:27:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T00:40:27.000Z (over 2 years ago)
- Last Synced: 2025-03-21T06:25:30.840Z (over 1 year ago)
- Topics: 2023, 42, c, makefile, minishell
- Language: C
- Homepage:
- Size: 154 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minishell
## Compile
```
make
```
## Mandatory
- [x] Display a prompt when waiting for a new command.
- [x] Have a working history.
- [x] Search and launch the right executable (based on the PATH variable or using a
relative or an absolute path).
- [x] Avoid using more than one global variable to indicate a received signal. Consider
the implications: this approach ensures that your signal handler will not access your
main data structures.
- [x] Not interpret unclosed quotes or special characters which are not required by the
subject such as \ (backslash) or ; (semicolon).
- [x] Handle ’ (single quote) which should prevent the shell from interpreting the metacharacters in the quoted sequence.
- [x] Handle " (double quote) which should prevent the shell from interpreting the metacharacters in the quoted sequence except for $ (dollar sign).
- [x] Implement redirections :
- [x] < should redirect input.
- [x] > should redirect output.
- [x] << 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!
- [x] >> should redirect output in append mode.
- [x] Implement pipes (| character). The output of each command in the pipeline is
connected to the input of the next command via a pipe.
- [x] Handle environment variables ($ followed by a sequence of characters) which
should expand to their values.
- [x] Handle $? which should expand to the exit status of the most recently executed
foreground pipeline.
- [x] Handle ctrl-C, ctrl-D and ctrl-\ which should behave like in bash. In interactive mode :
- [x] ctrl-C displays a new prompt on a new line.
- [x] ctrl-D exits the shell.
- [x] ctrl-\ does nothing.
- [x] Your shell must implement the following builtins :
- [x] echo with option -n
- [x] cd with only a relative or absolute path
- [x] pwd with no options
- [x] export with no options
- [x] unset with no options
- [x] env with no options or arguments
- [x] exit with no options
## Bonus
- [ ] && and || with parenthesis for priorities.
- [ ] Wildcards * should work for the current working directory.