resoud false positif dans expansions et redirections
This commit is contained in:
@@ -263,10 +263,11 @@ echo “$rewtwet”
|
||||
|
||||
echo '\$'
|
||||
|
||||
export HELLO=hello
|
||||
echo $HELLO
|
||||
|
||||
export HELLO=hello; echo $HELLO
|
||||
|
||||
export HELLO=hello; echo $hello
|
||||
export HELLO=hello
|
||||
echo $hello
|
||||
|
||||
echo $
|
||||
|
||||
@@ -274,31 +275,9 @@ echo "$"
|
||||
|
||||
echo '$'
|
||||
|
||||
echo \$
|
||||
|
||||
echo "\$"
|
||||
|
||||
export HELLO=hello
|
||||
echo \$HELLO
|
||||
|
||||
export HELLO=hello
|
||||
echo \\$HELLO
|
||||
|
||||
export HELLO=hello
|
||||
echo "$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo "\$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo "\\$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo \\"$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo "\"\"$HELLO"
|
||||
|
||||
export TEST=ech
|
||||
"$TEST"o hello
|
||||
|
||||
@@ -321,3 +300,4 @@ echo $abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
|
||||
export TEST="export TEST=echo"
|
||||
$TEST hello
|
||||
$TEST hello
|
||||
|
||||
|
||||
@@ -168,18 +168,6 @@ echo hallo >x1 >x2 >x3
|
||||
|
||||
> file | cat < no_such_file
|
||||
|
||||
echo hello > out1.txt > out2.txt > out3.txt 2> err1.txt 2> err2.txt 2> err3.txt; cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
echo hello >> out1.txt >> out2.txt >> out3.txt 2>> err1.txt 2>> err2.txt 2>> err3.txt; cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls > out1.txt > out2.txt > out3.txt 2> err1.txt 2> err2.txt 2> err3.txt; cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls >> out1.txt >> out2.txt >> out3.txt 2>> err1.txt 2>> err2.txt 2>> err3.txt; cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls no_such_file > out1.txt > out2.txt > out3.txt 2> err1.txt 2> err2.txt 2> err3.txt; cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls no_such_file >> out1.txt >> out2.txt >> out3.txt 2>> err1.txt 2>> err2.txt 2>> err3.txt; cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
echo a > out
|
||||
echo b >> out
|
||||
echo c >> out
|
||||
@@ -199,25 +187,6 @@ echo hello 2147483648> file
|
||||
echo a > $NO_ENV | echo b
|
||||
unset NO_ENV
|
||||
|
||||
./a.out 3> file3 2> file2 1> file1
|
||||
cat file3 file2 file1
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
./a.out 1> file1 2> file2 3> file3
|
||||
cat file1 file2 file3
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
echo a 1> 1.txt 2> 2.txt 3> 3.txt
|
||||
./a.out 1>> 1.txt 2>> 2.txt 3>> 3.txt
|
||||
cat 1.txt 2.txt 3.txt
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
echo a 3> 3.txt 2> 2.txt 1> 1.txt 2> 2.txt 3> 3.txt
|
||||
echo b 1>> 1.txt 2>> 2.txt 3>> 3.txt 2>> 2.txt 1>> 1.txt
|
||||
./a.out 1>> 1.txt 2>> 2.txt 3>> 3.txt 2>> 2.txt 1>> 1.txt
|
||||
cat 1.txt 2.txt 3.txt
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
echo a > f
|
||||
echo b >> f
|
||||
cat f f f >> ff
|
||||
|
||||
@@ -12,9 +12,52 @@ echo $?
|
||||
|
||||
#---------------------------------------------
|
||||
# Race condition, unpredictable behaviour
|
||||
|
||||
echo DOET HET NIET > test1 | cat test1
|
||||
|
||||
|
||||
#---------------------------------------------
|
||||
# redirection stderr
|
||||
|
||||
echo hello > out1.txt > out2.txt > out3.txt 2> err1.txt 2> err2.txt 2> err3.txt
|
||||
cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
echo hello >> out1.txt >> out2.txt >> out3.txt 2>> err1.txt 2>> err2.txt 2>> err3.txt
|
||||
cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls > out1.txt > out2.txt > out3.txt 2> err1.txt 2> err2.txt 2> err3.txt
|
||||
cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls >> out1.txt >> out2.txt >> out3.txt 2>> err1.txt 2>> err2.txt 2>> err3.txt
|
||||
cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls no_such_file > out1.txt > out2.txt > out3.txt 2> err1.txt 2> err2.txt 2> err3.txt
|
||||
cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
ls no_such_file >> out1.txt >> out2.txt >> out3.txt 2>> err1.txt 2>> err2.txt 2>> err3.txt
|
||||
cat out1.txt out2.txt out3.txt err1.txt err2.txt err3.txt
|
||||
|
||||
./a.out 3> file3 2> file2 1> file1
|
||||
cat file3 file2 file1
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
./a.out 1> file1 2> file2 3> file3
|
||||
cat file1 file2 file3
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
echo a 1> 1.txt 2> 2.txt 3> 3.txt
|
||||
./a.out 1>> 1.txt 2>> 2.txt 3>> 3.txt
|
||||
cat 1.txt 2.txt 3.txt
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
echo a 3> 3.txt 2> 2.txt 1> 1.txt 2> 2.txt 3> 3.txt
|
||||
echo b 1>> 1.txt 2>> 2.txt 3>> 3.txt 2>> 2.txt 1>> 1.txt
|
||||
./a.out 1>> 1.txt 2>> 2.txt 3>> 3.txt 2>> 2.txt 1>> 1.txt
|
||||
cat 1.txt 2.txt 3.txt
|
||||
printf '#include<unistd.h>\nint main(){write(1, "fd1\\n", 4);write(2, "fd2\\n", 4);write(3, "fd3\\n", 4);}' > a.c && gcc a.c
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------
|
||||
# ; Semicolon separator
|
||||
|
||||
@@ -551,3 +594,24 @@ echo \{
|
||||
echo \}
|
||||
echo \~
|
||||
|
||||
echo \$
|
||||
|
||||
echo "\$"
|
||||
|
||||
export HELLO=hello
|
||||
echo \$HELLO
|
||||
|
||||
export HELLO=hello
|
||||
echo \\$HELLO
|
||||
|
||||
export HELLO=hello
|
||||
echo "\$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo "\\$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo \\"$HELLO"
|
||||
|
||||
export HELLO=hello
|
||||
echo "\"\"$HELLO"
|
||||
|
||||
Reference in New Issue
Block a user