-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.txt
37 lines (25 loc) · 1.38 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FIX THE PARSING
export A=luciekin && echo $A'chauffour'
--> The export is done, but its result is not used for the second command.
--------------------------------------------------------------------------------
IMPROVE THE PIPELINE
- Sequential instead of full setup. See if `cat | cat | ls`,
`sleep 2 | sleep 3` and `cat /dev/urandom | head -n 5` still work properly.
They should, as it's how Bash does it.
--------------------------------------------------------------------------------
THE "_" ENV VAR
- The "_" var is initialized to the input used to call the shell or script
(argv[0]). Keep this value for `$0`, and remove the var from the env list to
store it in the intern list.
- It doesn't show in the export list, because it belongs to the intern var
list. Don't ever export it.
- It is updated to the last arg of the most recent simple command (= no pipe).
- Within a pipeline, it is added to the env list and is set to the relative
path of the command (the future argv[0] of this command).
--------------------------------------------------------------------------------
THE "SHLVL" ENV VAR
- If the var doesn't exist when opening bigerrno or before calling execve,
initialize it to 0.
- Then, increment it when opening bigerrno.
- In the child process, decrement it unless the command is a shell.
--------------------------------------------------------------------------------