42-archive/42sh
2017-03-27 21:03:55 +02:00
..
42ShellTester bang stories 2017-03-27 19:55:56 +02:00
includes bang stories 2017-03-27 19:55:56 +02:00
libft merge 2017-03-27 18:09:16 +02:00
pdf interactive shell with termcaps 2016-10-28 21:24:29 +02:00
sample sample script 2017-03-27 18:07:24 +02:00
src correciton heredoc + error syntax 2017-03-27 21:03:49 +02:00
test case loop no more leaks 2017-03-27 03:48:30 +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
.valgrind.supp exitstatus function, so i can set ? variable in one line with not memory handling. No more leaks, sexy debug macro DG(), valgrind suppression, gitignore 2016-12-10 00:20:59 +01:00
auteur fichier auteur 2017-03-15 18:22:24 +01:00
donovan_segaults_06-02 starting to fix redirects 2017-02-06 23:49:58 +01:00
Makefile bang stories 2017-03-27 19:55:56 +02:00
README.md Refreshed README.md -- Still need infos 2017-03-24 13:05:08 +01:00
scriptheader.sh rectif retour des process non fork 2017-03-24 14:59:46 +01:00
update_makefile.sh modif makefile + script 2017-03-19 13:44:44 +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