https://github.com/uael/42sh
42 shell school project, support for job-control, shell script, globbing, aliases, ..
https://github.com/uael/42sh
c job-control shell shell-script
Last synced: 2 months ago
JSON representation
42 shell school project, support for job-control, shell script, globbing, aliases, ..
- Host: GitHub
- URL: https://github.com/uael/42sh
- Owner: uael
- License: unlicense
- Created: 2017-11-28T19:27:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-28T13:04:26.000Z (about 7 years ago)
- Last Synced: 2025-03-30T06:07:51.342Z (2 months ago)
- Topics: c, job-control, shell, shell-script
- Language: C
- Homepage: https://www.42.fr
- Size: 1.61 MB
- Stars: 18
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 42sh
[](https://travis-ci.org/uael/42sh)## Grade:
##### 125/100 (outstanding project * 5)## Subject:
[Subject](https://cdn.intra.42.fr/pdf/pdf/183/42sh.fr.pdf)
## Mandatory part:
- [x] Prompt without line edition.
- [x] Builtins `cd`, `echo`, `exit`, `env`, `setenv`, `unsetenv` with there options.
- [x] Executing simple commands with there parameters using `PATH`.
- [x] Support for redirection `>`, `>>`, `<`and `|`.
- [x] Logical operand `&&`and `||`.
- [x] Separator `;`.## Optional feature (five of theses are mandatory to validate the project):
- [x] Inhibitors `"`, `'`and `\`.
- [x] Advanced redirections: aggregation of file output and heredoc `<<`.
- [x] Globbing: `*`, `?`, `[]`, `{}`, etc.
- [x] Backquotes \`.
- [x] Subshell with operand `()`.
- [x] Local variable and builtin `unset` and `export`.
- [x] History with builtin `history`and `!` with options.
- [x] Advanced line edition.
- [x] File descriptors and builtin `read` with options.
- [x] Dynamical autocompletion.## Optional feature highly appreciated:
- [x] Job Control and builtins `job`, `fg`, `bg` and operand `&`.
- [X] Shell Scripting: bang (!), variable assignements, brace group, if, while, until, for and functions## Bonuses
- [X] Advanced dollar expansion `$(..)`, `$((..))`, `$[..]`
- [X] Tilde expansion `~`, `~`, `~-`, `~+`
- [X] Range expansion `{..}` and `{....}`
- [X] Advanced redirections operator `&>`, `&>>`, `<>`, `<<<` and `|&`
- [X] Aliases, builtin alias `alias [-p] [name[=value] …]` and expansion
- [X] Builtin env advanced options `-u name` and `[name=value]`
- [X] Inline variables `[name=value] binary [arguments...]`
- [X] Binary hashtable
- [X] Rights in the PATH## Usage
```
Usage: ./42sh [option] [script-file] [script arguments...]
ush options:
--help: this *useful* help message!
ush keymap:
: Go to begin of line.
: Go to end of line.
: Enter visual mode.
: Yank in visual mode.
: Paste.
: Exit or delete in visual mode.
: Cancel line edition.
: Clear the screen.
: Move per word.
: Move per line.
: Go up in the history.
: Go down in the history.
!!: Retype the last command.
!n: Retype the n command from the begin of history.
!-n: Retype the -n command from the last command.
!name: Search for a command beginning with name.
```