qq modifs pour pull
This commit is contained in:
39
error.md
39
error.md
@@ -1,16 +1,39 @@
|
||||
1. redirection et quotes expansion
|
||||
1. redirection & quotes expansion
|
||||
|
||||
```
|
||||
bash> echo "hello" > "file"
|
||||
bash> ls
|
||||
bash$ echo "hello" > "file"
|
||||
bash$ ls
|
||||
file
|
||||
bash>
|
||||
bash$
|
||||
```
|
||||
|
||||
```
|
||||
minishell> echo "hello" > "file"
|
||||
minishell> ls
|
||||
minishell$ echo "hello" > "file"
|
||||
minishell$ ls
|
||||
'"file"'
|
||||
minishell>
|
||||
minishell$
|
||||
```
|
||||
2.
|
||||
2. redirection & open
|
||||
|
||||
`prompt$ > newfile`
|
||||
create file `newfile` in bash, but not in minishell
|
||||
|
||||
3. redirection & open
|
||||
|
||||
ok `prompt$ echo "hello" > $not_a_variable`
|
||||
ok does'nt create a file in bash, but does in minishell
|
||||
|
||||
4. redirection & variables expansion
|
||||
|
||||
```
|
||||
export NEWVAR="newfile"
|
||||
echo hello > $NEWVAR
|
||||
```
|
||||
create file "newfile" in bash, but a file named "'$NEWVAR'" in minishell
|
||||
|
||||
5. redireciton & pipes
|
||||
|
||||
`ls | < not_a_file cat`
|
||||
gives an error about "not_a_file" and stop in bash, but in minishell it continues forever
|
||||
(`< not_a_file cat` works fine in both bash and minishell)
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
echo bonjour > $test
|
||||
ls
|
||||
rm '$test'
|
||||
|
||||
> log echo coucou
|
||||
ls
|
||||
rm log
|
||||
|
||||
cat < >
|
||||
|
||||
@@ -14,63 +12,48 @@ cat > >
|
||||
|
||||
> a ls > b < Makefile
|
||||
ls
|
||||
rm a b
|
||||
|
||||
echo > a Hello World!
|
||||
ls
|
||||
rm a
|
||||
|
||||
> a echo Hello World!
|
||||
ls
|
||||
rm a
|
||||
|
||||
echo bonjour > test\ 1
|
||||
ls
|
||||
rm test
|
||||
|
||||
echo bonjour >>> test
|
||||
|
||||
echo bonjour > > out
|
||||
ls
|
||||
rm out
|
||||
|
||||
echo 2 >> out1 > out2
|
||||
ls
|
||||
rm out1 out2
|
||||
|
||||
echo 2 > out1 >> out2
|
||||
ls
|
||||
rm out1 out2
|
||||
|
||||
cat < blablabla
|
||||
|
||||
echo test > file test1
|
||||
ls
|
||||
rm file
|
||||
|
||||
not_cmd bonjour > salut
|
||||
ls
|
||||
rm salut
|
||||
|
||||
>testt
|
||||
ls
|
||||
|
||||
rm testt
|
||||
>>testt
|
||||
ls
|
||||
|
||||
rm testt
|
||||
<testt
|
||||
ls
|
||||
rm testt
|
||||
|
||||
touch testt
|
||||
<testt
|
||||
rm testt
|
||||
|
||||
rm testt
|
||||
<testt
|
||||
rm testt
|
||||
|
||||
cat <a <b >c >d
|
||||
|
||||
@@ -81,12 +64,10 @@ cat a
|
||||
cat b
|
||||
cat c
|
||||
cat d
|
||||
rm a b c d
|
||||
|
||||
|
||||
cat a | < b cat | cat > c | cat
|
||||
ls
|
||||
rm a b c
|
||||
|
||||
echo hello >a
|
||||
echo byebye >b
|
||||
@@ -96,11 +77,14 @@ ls
|
||||
cat a
|
||||
cat b
|
||||
cat c
|
||||
rm a b c
|
||||
|
||||
echo bonjour > $test w/ t
|
||||
ls
|
||||
|
||||
export TEST=newfile
|
||||
echo hello > $TEST
|
||||
ls
|
||||
|
||||
echo > "hardesttest.txt"
|
||||
|
||||
echo adding stuff >> working.txt
|
||||
|
||||
@@ -143,7 +143,7 @@ cd $(dirname $0)
|
||||
function test_minishell
|
||||
{
|
||||
# execute commands in bash, and logs results
|
||||
bash_execution=$( echo "$@" | bash 2>/dev/null )
|
||||
bash_execution=$( echo "$@" | bash -i 2>/dev/null )
|
||||
delete_files
|
||||
minishell_execution=$( echo "$@" | ./minishell 2>/dev/null )
|
||||
delete_files
|
||||
|
||||
Reference in New Issue
Block a user