tests ok pour modifier fonctionnement de minishell

This commit is contained in:
hugogogo
2021-11-05 16:26:27 +01:00
parent 5a98927eff
commit 0a33916c75
4 changed files with 95 additions and 94 deletions

View File

@@ -1,9 +1,30 @@
## understanding some things :
- [how to send EOF to stdin of a shell process](https://unix.stackexchange.com/questions/493578/how-to-send-d-eot-character-to-stdin-of-a-shell-process)
- [get root access 1](https://vitux.com/how-to-become-root-user-in-ubuntu-command-line-using-su-and-sudo/)
- [get root access using sudo su](https://superuser.com/questions/408990/how-do-i-log-out-of-sudo-su)
- [get root access 1](https://vitux.com/how-to-become-root-user-in-ubuntu-command-line-using-su-and-sudo/)
- [get root access using sudo su](https://superuser.com/questions/408990/how-do-i-log-out-of-sudo-su)
- [what is a tty](https://www.howtogeek.com/428174/what-is-a-tty-on-linux-and-how-to-use-the-tty-command/)
```
| BASH | MINISHELL |
-----------------------------------
| print | action | print | action |
---------------|-----------------|----------------|----------------|
| SIGINT / ctrl-C | ^C | \n | ^C | exit |
prompt> |-----------------|----------------|----------------|
| EOF / ctrl-D | exit | exit | Ø | \n |
---------------|-----------------|----------------|----------------|
| SIGINT / ctrl-C | bla^C | \n | bla^C | exit |
prompt> blabla |-----------------|----------------|----------------|
| EOF / ctrl-D | Ø | Ø | Ø | Ø |
---------------|-----------------|----------------|----------------|
-> change signal handler for SIGINT, to print a \n instead of exit
-> change when readline receive an EOF and line is empty, to print exit and exit
-> when readline receive an EOF and line is empty, it return NULL
-> if line isn't empty it does nothing
```
## sommaire :
---
- [1. todo list :](#markdown-header-1-todo-list)