Skip to content

jolabour/42sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

192 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42sh

42sh is the last shell project of 42. This project aims to introduce us to the development of a shell. It's a group project that I realized with 4 people. We chose to make a posix bash style shell

compile and run

run make && ./42sh

feature required

  • simple command (example:ls)
  • environement variable (example:$PATH)
  • local variable (example:a=b; echo ${a})
  • signal management (example:CTRL-C)
  • job control (example:ls &)
  • temporary variable (example:HOME=/tmp cd)
  • simple expansion (example:echo ${PATH})
  • expansion of special parameters (example:echo ${?})
operators
  • >
  • <
  • <<
  • >>
  • <&
  • >&
  • io_number
  • |
  • ||
  • &&
  • ;
builtins
  • cd
  • echo
  • exit
  • type
  • set
  • unset
  • export
  • jobs
  • fg
  • bg
line edition
  • LEFT AND RIGHT ARROWSmove cursor on the right or left. In select mode, move the select part
  • UP AND DOWN ARROWS move in the historic
  • DEL clear a character. In select mode, del the select part and exit select mode
  • HOME move to the beginning of the line
  • END move to the end of the line
  • OPT+UP move up
  • OPT+DOWN move down
  • CTRL-C print new prompt
  • CTRL-D del on the right if line in not empty otherwise leaves the shell
  • OPT-B move to previous word
  • OPT+F move to next word
  • OPT+V past the copy line
  • OPT+C enter in select mode. In select mode, copy the select part and exit select mode
  • OPT+X enter in select mode. In select mode, cut the select part and exit select mode

optional feature

  • quoting ” (double quote), ’ (simple quote) et \ (backslash)
  • pattern matching (globing) : *, ?, [], !
  • tilde expansions and additional formats of parameters
  • grouped command and subshell : (), {};
  • command substitution : $()
  • arithmetic expansion : $(())
  • processus substitution : <(), >()
  • complete management of the history
  • dynamic completion
  • Vi and Readline for the line edition
  • alias and unalias buitlins
  • hash builtin and hashtable for binary
  • test builtin

final mark

100/100

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors