Skip to content

Latest commit

 

History

History
47 lines (41 loc) · 3 KB

README.MD

File metadata and controls

47 lines (41 loc) · 3 KB

42sh

This is the final project of the Unix branch at Le 101, the culmination of the first year of study: a working shell, full of cool features!

This project was coded in C, following the Norm used by the school (see References below). The program is not allowed to crash, nor leak any memory.

It was designed for MacOS but should work fine on Linux: simply make and enjoy!

Made with love and care by Thibault Le Cozanet, Vitor Branco & Vincent Schlumberger

Mandatory part

  • Execution of commands with arguments and path management
  • Line acquisition (prompt display, reading of a command line, proper space and tabulations management)
  • Builtins with their POSIX options: cd, echo, exit, env, setenv, unsetenv
  • Error and commands' return value management
  • Redirections: ">", ">>", "<", "|"
  • Logical operators: "&&", "||"
  • Separator: ";"

Bonuses

  • Dynamic autocompletion with Tab
  • Hash table for binaries, hash command
  • Command history, history and ! builtins
  • Local variables, unset and export builtins
  • Inhibitors: double quote ("), simple quote ('), backslash (\)
  • Advanced redirections: file output aggregation and heredoc (<<)
  • Line edition
    • Cursor movement
      • Right/Left Move letter by letter
      • Alt + Right/Left Move word by word
      • Alt + Up/Down Move up/down from one line to another in the command while remaining in the same column
      • Home/End Get to the beginning/end of the command
    • Cut/copy/paste
      • Alt + A Cut the whole command
      • Alt + S/D Cut everything before/after the cursor
      • Alt + Z Copy the whole command
      • Alt + X/C Copy everything before/after the cursor
      • Alt + V Paste
  • Ctrl + L to clear the screen

References

This a list of ressources we found useful in making this project.