I've begun working with Bash and have picked up on redirection of stdout and stderr, but as I have started working with Curl and Wget I notice that both of these programs send not only their errors to stderr but also their output from stdout. My script downloads a file with curl and redirects any errors to a file, then the script checks if the error file exists and if it does the script terminates after returning the error message. I am choosing to redirect the stderr to a file first so I can achieve some formatting on the error as I do not want to fill the end users entire screen with the contents of the curl or wget status if it fails. The issue is this file is created regardless of if the download succeeds or not. I really am curious as to why both stderr and stdout are sent to the same place and if this occurs with any other programs I should be aware of.
The curl command:
curl https://rclone.org/install.sh 2> /tmp/install_errors