I am learning the UNIX environment and have a question.. When it comes to redirecting a std error to a file, what happens if the file we redirect to has writing permissions denied to the user?
./command >file 2>&1 ./command 2>&1 >file
What happens in the first instance to the error message? Does it automatically get discarded? I get the same error for both lines, that permission is denied but since the system reads from left to right, whats the difference between the way it's handled?
Any links to tutorials that go into the mechanism behind this would be helpful, so far I can only find information on how it handles it if we have writing permissions.