Can anyone help me understand this seemingly odd behavior of how the shell parses the redirects..?
$ cat > test.txt Line 1 Line 2 $ ls -i dummy.txt dummy2.txt ls: dummy.txt: No such file or directory ls: dummy2.txt: No such file or directory $ $ cat test.txt > dummy.txt > dummy2.txt $ cat dummy2.txt Line 1 Line 2 $ cat dummy.txt $
Interesting! I would have expected the output from
cat test.txt to be redirected into
dummy.txt and then the shell would read
dummy.txt as the input for
dummy2.txt. But somehow the shell parses it differently...
So how does the content of
test.txt be taken as the input for
dummy2.txt, by bypassing
Note: Same result in bash and ksh..