I encounter similar behavior with monit application under Linux. For whatever reason it outputs regular messages (not errors) into STDERR.
>I was surprised to find out that I could not always capture the output of a command to a file. Some examples:
>
>git add -h > temp.txt && output captured in file temp.txt
>git add > temp.txt && output NOT captured in file temp.txt
>git branch -h > temp.txt && output NOT captured in file temp.txt
>git branch > temp.txt && output captured in file temp.txt
>
>
>Searching on the internet I found out that commands have at least two different output streams, STDOUT and STDERR
>Also found that with a special command redirection format you can capture both STDOUT and STDERR to a file:
>
>git add > temp.txt 2>&1 && output IS captured in file temp.txt because command output is an error message in STDERR
>
>
>However, in the case of "git branch -h", GIT sends its output to STDERR, even though it should go to STDOUT !
>Did Linus Torvalds (author of GIT) play Trick or Treat on me on this Halloween day?
>
>git branch -h > temp.txt 2>&1 && output IS captured in file temp.txt
>
>
>Alex
--sb--