tests de pipes et fork et execve et wait

This commit is contained in:
hugogogo
2021-10-17 22:12:55 +02:00
parent 98f247a378
commit 226829b891
4 changed files with 94 additions and 25 deletions

View File

@@ -56,7 +56,7 @@
*[\go to sommaire](#markdown-header-sommaire)*
## 2. parsing :
## 2. lexer (lexique analyser :
---
### 2.1 methode arbre binaire :
@@ -64,35 +64,46 @@
[transformer arbre normal en arbre binaire](https://fr.wikipedia.org/wiki/Arbre_binaire#Transformation_d'un_arbre_quelconque_en_un_arbre_binaire)
```text
ARCHITECTURE :
arbre lexical :
all
expend $
. pipes
. . redirections (program function or file)
. . . arguments (nom arg arg arg ...)
. . . .
EXEMPLE : . .
[sort < ./prgrm 'arg1 '$VARIABLE" arg3" | grep "word.$EXTENSION" | wc -l > file]
[sort < ./prgrm 'arg1 'arg2" arg3" | grep "word.md" | wc -l > file]
. [sort < ./prgrm 'arg1 'arg2" arg3"]
. . [sort]
[< file ./prgrm 'arg1 '$VARIABLE" arg3" | grep "word.$EXTENSION" | wc -l > file]
. [< file ./prgrm 'arg1 'arg2" arg3"]
. . [file]
. . [./prgrm 'arg1 'arg2" arg3"]
. . . [./prgrm]
. . . ['arg1 ']
. . . [arg2]
. . . [" arg3"]
. . . ['arg1 'arg2" arg3"]
. [grep "word.md"]
. . . [grep]
. . . ["word.md"]
. [wc -l > file]
. . [file]
. . [wc -l]
. . . [wc]
. . . [-l]
. . [file]
```
*[\go to sommaire](#markdown-header-sommaire)*
> export TEST=""
> ./test_argv $TEST foo
argv[0] : [./test_argv]
argv[1] : [foo]
> export TEST=" bar "
> ./test_argv foo"$TEST"foo
argv[0] : [./test_argv]
argv[1] : [foo bar foo]
> export TEST="bar"
> ./test_argv "foo "$TEST" foo"
argv[0] : [./test_argv]
argv[1] : [foo bar foo]
## 3. gerer les quotes et la separation des arguments :
---