Output and Error redirection in Shell script (MinGW)
I want to have a shell script in which i compile a project using the 'make' command and i want to write the entire output including the make output and errors to a log file as well as display it on the standard output. On GNU/Linux, the following syntax works properly:
$ make |& tee ./build.log
On windows, using MinGW, the above command gives an error, so i use the following command:
$ make | tee ./build.log
So, i have removed the '& from the above command.
But this command only writes the output of the make command to the log file. If i use the following command, then the log file is properly produced but nothing is written on the output:
$ make > ./build.log 2>&1
How can i write the entire output including the make output and errors to the output stream as well as the log file on the MinGW shell?
Thanks in advance!!!