ajout un fonctionnement signaux avec heredoc
This commit is contained in:
38
README.md
38
README.md
@@ -123,18 +123,40 @@ test
|
|||||||
|
|
||||||
- [infos ici](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03)
|
- [infos ici](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_05_03)
|
||||||
|
|
||||||
|
6. un heredoc interrompu par un Ctrl-D n'arrete pas la pipeline, mais un Ctrl-C si :
|
||||||
|
```text
|
||||||
|
[bash]$ echo << EOF | wc
|
||||||
|
> ^D bash: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
|
||||||
|
1 0 1
|
||||||
|
[bash]$ echo << EOF | wc
|
||||||
|
> ^C
|
||||||
|
[bash]$
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## schema d'execution :
|
## schema d'execution :
|
||||||
```text
|
```text
|
||||||
_________________________________________________
|
________________________________________________
|
||||||
|LOOP: shell_loop() |
|
|LOOP: shell_loop() |
|
||||||
| signal(SIGINT, handler) |
|
| ______________________________________________ |
|
||||||
| mode interactif -> readline return line_input |
|
||mode interactif ||
|
||||||
| signal(SIGINT, ignore) |
|
|| *signal(SIGINT, handler)* ||
|
||||||
| lexing |
|
|| readline return line_input ||
|
||||||
| parsing |
|
||______________________________________________||
|
||||||
| execution |
|
| ______________________________________________ |
|
||||||
|_________________________________________________|
|
||mode execution ||
|
||||||
|
|| *signal(SIGINT, ignore)* ||
|
||||||
|
|| ____________________________________________ ||
|
||||||
|
||| lexing |||
|
||||||
|
|||____________________________________________|||
|
||||||
|
|| ____________________________________________ ||
|
||||||
|
||| parsing |||
|
||||||
|
|||____________________________________________|||
|
||||||
|
|| ____________________________________________ ||
|
||||||
|
||| execution |||
|
||||||
|
|||____________________________________________|||
|
||||||
|
||______________________________________________||
|
||||||
|
|________________________________________________|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2021/11/11 18:46:43 by lperrey #+# #+# */
|
/* Created: 2021/11/11 18:46:43 by lperrey #+# #+# */
|
||||||
/* Updated: 2021/11/18 13:17:19 by hulamy ### ########.fr */
|
/* Updated: 2021/11/18 17:17:42 by hulamy ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2021/10/23 18:56:53 by lperrey #+# #+# */
|
/* Created: 2021/10/23 18:56:53 by lperrey #+# #+# */
|
||||||
/* Updated: 2021/11/18 13:18:53 by hulamy ### ########.fr */
|
/* Updated: 2021/11/18 17:02:16 by hulamy ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ void sigint_handler_interactive(int signum)
|
|||||||
void sigint_handler_heredoc(int signum)
|
void sigint_handler_heredoc(int signum)
|
||||||
{
|
{
|
||||||
(void)signum;
|
(void)signum;
|
||||||
write(1, "T", 1);
|
write(1, "\n", 1);
|
||||||
rl_on_new_line();
|
rl_on_new_line();
|
||||||
rl_replace_line("", 1);
|
rl_replace_line("", 1);
|
||||||
rl_redisplay();
|
rl_redisplay();
|
||||||
|
|||||||
Reference in New Issue
Block a user