Description Redirections tests
echo a b c >>f ✅
echo a >>f b ✅
echo >>f a b ✅
<in.txt cat >>out.txt tail ✅
echo <in.txt cat >>out.txt ✅
echo a >f1 b >>f2 c 2>>errs ❓
>f echo a 🔴
<in.txt grep "foo" → prints matches from in.txt 🔴
>f1 echo a >>f2 b → f1 has a, f2 has b appended ⇒ look for the last redirection on right or left and connect it to the cmd.
>f1 >f2 >f3 echo a ”a” should always got in the last (f3). 🔴
<in tr a-z A-Z >out
echo >>f "some text” ✅
echo > f1 "a b" >> f2 'c d' ✅
echo >> 🔴 (wrong exit code)
> 🔴 (wrong exit code)
cat <<EOF >out … lines … EOF ✅
cat <<'EOF' >out … $USER should NOT expand … EOF
> output.txt ✅
echo bonjour > bj.txt ✅
cat < bj.txt ✅
cat < bj.txt > test.txt ✅
cat < test.txt >> new.txt ✅
cat < test.txt ✅
cat < new.txt ✅
echo "This is a test" > test.txt ✅
cat < test.txt < test.txt < test.txt < test.txt < test.txt < test.txt ✅
cat < test.txt < test.txt < test.txt < test.txt < new.txt ✅
cat < test.txt > a1 > a2 >> a3 > a4 >> a5 > a6 ✅
not_cmd bonjour > salut ✅
cat < > (Works but with wrong error message)
cat < < (Works but with wrong error message)
cat > >
Reactions are currently unavailable
You can’t perform that action at this time.
Redirections tests
echo a b c >>f✅echo a >>f b✅echo >>f a b✅<in.txt cat >>out.txt tail✅echo <in.txt cat >>out.txt✅echo a >f1 b >>f2 c 2>>errs❓>f echo a🔴<in.txt grep "foo"→ prints matches fromin.txt🔴>f1 echo a >>f2 b→f1hasa,f2hasbappended ⇒ look for the last redirection on right or left and connect it to the cmd.>f1 >f2 >f3 echo a”a” should always got in the last (f3). 🔴<in tr a-z A-Z >outecho >>f "some text”✅echo > f1 "a b" >> f2 'c d'✅echo >>🔴 (wrong exit code)>🔴 (wrong exit code)cat <<EOF >out… lines …EOF✅cat <<'EOF' >out…$USERshould NOT expand …EOF> output.txt✅echo bonjour > bj.txt✅cat < bj.txt✅cat < bj.txt > test.txt✅cat < test.txt >> new.txt✅cat < test.txt✅cat < new.txt✅echo "This is a test" > test.txt✅cat < test.txt < test.txt < test.txt < test.txt < test.txt < test.txt✅cat < test.txt < test.txt < test.txt < test.txt < new.txt✅cat < test.txt > a1 > a2 >> a3 > a4 >> a5 > a6✅not_cmd bonjour > salut✅cat < >(Works but with wrong error message)cat < <(Works but with wrong error message)cat > >