Answer the question
In order to leave comments, you need to log in
PowerShell. How to redirect error output to both file and terminal at the same time?
When compiling, you need to send the standard error output to the "error.txt" file, BUT , while the terminal should also have the same output:
g++ test.cpp -o test 2>> error.txt
Answer the question
In order to leave comments, you need to log in
It's the mistakes? then the easiest way is to a file, and then read it,
and if everything is in a row, then
g++ test.cpp -o test 2>&1 | Tee-Object -Filepath error.txt
invoke-command { 'txt1'; write-error 'err'; 'txt2' } -ErrorVariable e
#пример вызова внешней команды
invoke-command { python 1.py 2>&1 } -ErrorVariable e
$e | Out-File error.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question