Our project 42SH is a recreation of a Unix shell based on TCSH, written entirely in C.
For this project we chose the shell base created by one of our team members, Alcibiade Streit-Soumaila,
and implemented almost all TCSH features, except for command group and command substitution.
This project was completed over the course of 5 weeks by our team of 5 members.
- Command execution
- PATH handling
- Environment variable management
- Pipes
- Redirections
- Command separators (;)
- Job control
- Logical operators (&& and ||)
- Parenthesis
- Inhibitors
- History management
- Aliases
- Signal handling
- Builtin commands
- Error handling
- Which
- Where
- if
- foreach
- repeat
- Scripting
Compile our project with :
makeAnd run our shell with :
./42shOnce inside the shell, you can try classic TCSH supported commands and our builtin commands.
- cd
- env
- setenv
- unsetenv
- alias
- history
- set
- unset
- if
- repeat
- foreach
- where
- which
- jobs
- fg
- bg
- exit
Bonus builtin commands are implemented as well.
Compile with :
make bonusAnd run with :
./42shBelow you will find a table containing the commands and their descriptions.
| Commands | Description |
|---|---|
| pelophylax | short description about frogs |
| flipcoin | coin simulation |
| throwdice | dice simulation |
| hangman | play hangman |
| tictactoe | play Tic Tac Toe |
| guessnumber | guess a random number |
| mambo | play mambo sound |
| yippee | play yippee sound |
| velkoz | show velkoz |
| banana | show a ... banana |
Our functions are in a src folder and then divided in folders organized by features :
src/
|--alias/
|--autocompletion/
|--bonus/
|--built_in/
|--command_utilities/
|--error/
|--free/
|--history/
|--initialisation/
|--jobs/
|--loop_tcsh/
|--redirection/
|--repeat/
|--tools/
|--user/
|__var_interpreters/
Unit tests and functional tests are available as well.
Run unit tests with:
make tests_runRun functional tests with:
make You can find more information in the README file in
the test folder.
Use the help flag to display more information about the command.
the_command -hor
the_command --helpAlcibiade Streit Soumaila -> dev
Alessendro Paris -> dev, tester
Galya Packer -> dev, tester
Ugo Pascallon -> dev, scrum master
Lucas Eeckhoutte -> dev