This project is about writing the most stable and most complete UNIX(POSIX) shell possible. There are many other shells, such as bash, csh, tcsh, ksh, ash, etc. 42sh shell tries to replicate there basic behavior.
- The following builtins including all their features if they have any (the strict minimum being the features listed in
POSIXstandard):alias!historyexportreadexeccdechoexitenvsetenvunsetenv
- The following logical operators "&&" and "||".
- The ";" separator.
- Inhibitors:
"(double quote),’(simple quote) and\(backslash). - Redirections:
>,>|,>>,<,<>,<<(heredoc),<<-,<<<(herestr),>&,<&,&>,&>>. - Pipelines:
|. - Globbing:
*,?,[],{}(without using theglob(3)function!). - Command substitution:
‘and$(). - Sub shells using the
()operators. - Local variables and unset and export builtins.
- Command history and
historyand!builtins including all their features. - Line edition (simple reimplement famous GNU readline library):
- Edit the line where the cursor is located.
- Move the cursor left and right to be able to edit the line at a specific location.
- Use up and down arrows to navigate through the command history which we will then be able to edit if we feel like it (the line, not the history)
- Cut, copy, and/or paste all or part of a line.
- Move directly by word to word the left or the right.
- Go directly to the beginning or the end of a line by pressing home and end.
- Write AND edit a command over a few lines. (alt+UP and alt+DOWN allow to go from one line to another in the command while remaining in the same column or otherwise the most appropriate column.)
- Completely manage quotes and double quotes, even on several lines (expansions excluded).
- Dynamic autocompletion.
- File descriptors(
exec) and thereadwith all its features. - Shell scripts
- Job control the
jobs,fgandbgbuiltins, and the&operator.