42-archive/42sh
2017-03-29 17:15:41 +02:00
..
42ShellTester andor + control flow 2017-03-29 17:15:41 +02:00
includes andor + control flow 2017-03-29 17:15:41 +02:00
libft merge 2017-03-29 15:27:59 +02:00
pdf removed FDF pdf 2017-03-28 07:45:53 +02:00
sample new correctif andor 2017-03-29 16:55:27 +02:00
src andor + control flow 2017-03-29 17:15:41 +02:00
.gitignore before pull 2017-03-13 14:06:54 +01:00
.gitmodules libft submodule reinit because of detached head state 2016-11-29 20:40:53 +01:00
.tags tokenization finished. interactive shell improvements for signal handlind (ISIG option turned off). next step is parsing, thinking of AST structure 2016-11-12 23:51:34 +01:00
another_file new correctif andor 2017-03-29 16:53:06 +02:00
auteur norme ok, compilation ok, fichier auteur ok, nom binaire ok 2017-03-29 11:09:27 +02:00
file new correctif andor 2017-03-29 16:53:06 +02:00
Makefile andor + control flow 2017-03-29 17:15:41 +02:00
README.md Refreshed README.md -- Still need infos 2017-03-24 13:05:08 +01:00

42sh

42sh school project.

Mandatory part:

  • Prompt without line edition.
  • Builtins cd, echo, exit, env, setenv, unsetenv with there options.
  • Executing simple commands with there parameters using PATH.
  • Support for redirection >, >>, <and |.
  • Logical operand &&and ||.
  • Separator ;.

Optional feature (five of theses are mandatory to validate the project):

  • Inhibitors ", 'and \.
  • Advanced redirections: aggregation of file output and heredoc <<.
  • Globbing: *, ?, [], {}, etc.
  • Backquotes `.
  • Subshell with operand ().
  • Local variable and builtin unset and export.
  • History with builtin historyand ! with options.
  • Advanced line edition.
  • File descriptors and builtin read with options.
  • Dynamical autocompletion.

Optional feature highly appreciated:

  • Job Control and builtins job, fg, bg and operand &.
  • Shell Scripting.

Shell / Subshell

Line editing

Keys Functions
Opt+C
Opt+X
Opt+V
Copy
Cut
Paste
Opt+<
Opt+>
Move per words.
Opt+^
Opt+v
Move per line.
Ctrl+L Clear screen.
Ctrl+C Terminate/Kill current foreground process.
Ctrl+Z Suspend/Stop current foreground process.

History

Keys Functions
^
v
Browse the history.
Ctrl+R Research function.
!! Retype the last command.
!n Retype the n(numerical value) command from the begin of history.
!-n Retype the -n(numerical value) command from the last command.
!name Search for a command beginning with name.
!?name Search for a command which contain name.

Autocompletion

Autocompletion works with binary, path and env variable. Output is colored upon type. Using arrows to navigate is supported. Autorefreshing with a new input from the user: modification of the list of possibility.

Commands Functions
$> l[tab] Search for binary.
$> ls s[tab] Search for path/files.
$> $[tab] Search for variables in env.

Globbing

Pattern Behavior
* Everything.
** Match directory and sub-directory.
? Single char.
[a-z] Match range from a to z.
[!a-z] [^a-z] Exclude range from a to z.
{ab, ac} Match ab or ac.

Hash table

Commands Functions
hash List the content of the hash table.
hash -r Clear the memory of the hash table.

Job Control

Commands Functions
jobs List all the current running jobs.
fg Bring the most recent process to foreground.
fg n Bring the specified jobs to foreground where n is the numerical value of the process found in jobs.

scripting