cat > filename << EOF
vs cat << EOF > filename
When I tested it, it looks like they are equivalent but I'm not fully understanding why that is the case.
I understand the purpose of this command is to continually STDOUT into filename until I type EOF and then CTRL-D.
cat > filename << EOF
(in terms of its sequence) makes sense to me: output stuff into filename until I hit EOF to tell it to stop.
But I was surprised that cat << EOF > filename
works too. I've been told that bash reads from left to right. In this case, how is my STDOUT getting to filename?